Home | Advertising Info103 USERS CURRENTLY ONLINE   
   Site Search Contact Us Saturday, November 01, 2014  
 
 


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



DISCUSSION ARCHIVES
 
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 source code database MS SQL MS Access .mdb adovbs.inc cookies calendar codes sql commands scripts asp programming tutorials iis web server components CJWSoft ASPProtect ASPBanner ASPClassifieds



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




ASPProtect

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



 

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
b=left(b,len(b)-1)
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

Next%>

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 - 2014 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 help tutorial how to ASP Help ASP Tutorials ASP Programming ASP Code - ASP Free 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