How do i count elements in vbscript array?

Well the question is on the subjkect line, i need to know how many elements are there in the array, is there a function?:confused:

the function is uBound(arrayName)


countries(0) = UK
countries(1) = US
countries(2) = Canada
arrCount = uBound(countries) + 1
' 3 would be written to he browser

you use the ubound() function. this will return the highest index number in the array. because the array positioning is zero based, you can find the size of the array like this:

sizeOfArray = uBound(arrayName) + 1

thanks dhtmlgod and makeda. Actually it’s been 6 months that i haven’t used VBscript, i’m more aquainted with perl, javascript actionscript…etc