Split the string on the commer, then get the ubound of the array:
dim myArray,totalLen
MyArray = Split(Session("MemberId"), ",", -1, 1)
totalLen = ubound(myArray)
response.write totalLen
If you build the session var in a loop, incriment a counter as the string is created would be another way. Unless of course you intend to split the array anyway therefore the above method would be the one.
NOTE: The array starts at 0 so the result is 6 even though there are seven elements
Wind is your friend
Matt
|