vb Arrays

<%
	Dim myArray, myString
	
	myArray(0) = "First element"
	myArray(1) = "Second element"
	myArray(2) = "Third element"
	
	Response.Write(LBound(myArray))	'First element
	Response.Write(UBound(myArray))	'Third element

	myString = "first|second|third"
	myArray = Split(myString, "|")
	
	For i = 0 To UBound(myArray)
		Response.Write(myArray(i) & "<br />")
	Next
%>
Example of declaring an array and finding the first/last elements - and also looping through an array created by splitting a delimited string.

Updated: Friday 8th October 2010, 09:25pm

There are 0 comments

Leave a comment of your own

Comments are currently closed.