Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

count an element of a multidimensional array

Status
Not open for further replies.

denis60

Technical User
Apr 19, 2001
89
CA
Hi!
I'm looking for a code to find the size of an element in a multidimensional array. exemple
@tst=([1,2][1,2,3][1,2,3,4][1,2,3,4,5])
I find the size of the array with $#tst
but what is the code to find the size of element 0,1,2 etc.?

Thanks in advence
 
For a basic array, its just;

$#array = number of array

For a multidimentional array, I believe you need to use something like;

$#array[0]
$#array[1]
$#array[2]
$#array[2][0]

...etc

Hope that helps.

Cheers
 
The first post in this thread was posted twice. See thread219-957339 for replies to the original post.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top