Home | Advertising Info230 USERS CURRENTLY ONLINE   
   Site Search Contact Us Tuesday, May 24, 2016  

User Management Application with web based screens that allow you to manage users.
Banner Rotation system. Advertisers can monitor online statistical reports via their web browsers.
ASP Photo Gallery
Upload an unlimited amount of albums. Set up categories.Image resizing thumbnail creation.
Classifieds system. Set up categories. Users can register themselves. Supports picture uploads.

Try a free httpZip trial now and compress for less!

We didn't realize
the site was so popular.

Other Stuff

Active Server Pages asp search engine active server page asp application components tutorial CJWSoft ASPProtect ASPBanner ASPClassifieds

(Advanced)  (Components)  (Database)  (General)  (Vbscript)


Subject: Re: Count the number of values in an array string???
From: jason pinhut
Date: 12/25/2002 10:53:30 PM


you don't necessarily have to count the values first. below is some code i used to split an array from a multi-select (i wanted exactly 4 values to have been chosen) you may be able to tweak this method if you don't have a high maximum number of values. the basic idea is to check for a comma at the end of each value. no comma means you have the last value, so you know when to stop the loop. i chop off the comma and make the result a session variable. it's a bit ragged, but it might give you some ideas

strSentence = Request.Form("choice")
intcomma = InStr(strSentence, ",")
If len(strSentence) < 1 OR intcomma = 0 Then
Response.Redirect "invalid.asp"
End If

Dim OneDimArray
OneDimArray = split(strSentence)

For i=0 to 3

If i = 0 Then
a = OneDimArray(i)
a= left(a,len(a)-1)
Session("a") = a
End If

If i= 1 Then
b = OneDimArray(i)

intcomma1 = InStr(b, ",")
If len(b) < 1 or intcomma1 = 0 Then
Response.Redirect "blobby.asp"
End If
Session("b") = b
End If

If i = 2 Then
c = OneDimArray(i)

intcomma2 = InStr(c,",")
If len(c) <1 or intcomma2 = 0 Then
Response.Redirect "blobby2.asp"
End If
c = left(c,len(c)-1)
Session("c") = c
End If

If i = 3 Then
d= OneDimArray(i)
Session("d") = d
If len(d) = 0 OR len(d) > 3 Then
Response.Redirect "invalid.asp"
End If
End If


Previous Message

Follow Up - Re: Count the number of values in an array string??? - SI 2/9/2003 8:14:54 AM


   Active Server Pages Rule The World
Contact Us  
All artwork, design & content contained in this site are Copyright 1998 - 2016 PowerASP.com and Christopher J. Williams
Banner ads ,other site logos, etc are copyright of their respective companies.
STATS Unless otherwise noted - All Rights Reserved.

Active Server Pages ASP control controls class classes module script Scripts applet CJWSoft ASPProtect ASPBanner ASPClassifieds www.aspclassifieds.com, www.powerasp.com,www.cjwsoft.com,www.aspphotogallery.com,www.codewanker.com,www.aspprotect.com,www.aspbanner.com