Utilizing The Split Function Page 2

By ServerWatch Staff (Send Email)
Posted Aug 9, 1999


Watkins

corner.jpg (739 bytes) Utilizing The Split Function corner2.jpg (786 bytes)

Back to the article: click here

Here is an example of how the script works. Enter a several stock quotes below seperated by commas and then submit it. For example: "pep, tgo, yum, dg" would be a correct example, but "pep tgo yum dg" would not. In a follow up to this article, I will be showing you how to let users enter the information almost anyway they want and still let it come out correct on the backend.


You entered the following:
<% Dim strStockQuotes Dim araStockQuotes Dim intElements Dim i Dim strStockQuote strStockQuotes = request("stockquotes") ' This is the input from the form. if len(strStockQuotes) > 255 then response.write "Your string was too big. This limitation is only here for the purpose of server performance. This is not the limitation of the split function, infact, I do know the limitation. Heck, maybe there isn't. :)" elseif len(strStockQuotes) = 0 or isNull(strStockQuotes) then response.write "" else araStockQuotes = split(strStockQuotes, ",") intElements = ubound(araStockQuotes) ' Get the number of elements. response.write "

" For i = 0 to intElements strStockQuote = araStockQuotes(i) response.write strStockQuote & "
" Next response.write "
" end if %>

Page 2 of 2


Comment and Contribute

Your name/nickname

Your email

(Maximum characters: 1200). You have characters left.