Click to See Complete Forum and Search --> : How many elements in an array


jen
October 1st, 1999, 04:53 AM
Hi!
I have a function that takes an array of integers as argument. This is a dynamic array so I donīt know how may elements in this array.
How do I find that out?
Thanks in advance
Jen

Crazy D @ Work
October 1st, 1999, 05:17 AM
Use LBound to get the lower bound of the array (usually 0 or 1) and UBound to get the upperbound (last entry) of the array.

Crazy D @ Work :-)

chilakamati
October 2nd, 1999, 03:12 AM
You could use the LBound and the Ubound functions to return the lower/upper bounds of the array
for eg.,
dim aryNames(10)

MsgBox LBound(aryNames)
MsgBox UBound(aryNames)