Digital Workshop

Welcome to the Digital Workshop Message Boards
It is currently January 6th, 2025, 9:43 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: count array elements
PostPosted: January 20th, 2005, 1:06 pm 
Offline

Joined: January 19th, 2005, 5:15 pm
Posts: 83
Location: Netherlands
what is the easiest way to count array elements.

I'm a php programmer, so I'm searching for something like a count($array) function.


Top
 Profile  
 
 Post subject:
PostPosted: January 20th, 2005, 1:30 pm 
Offline

Joined: October 25th, 2004, 12:27 pm
Posts: 526
Location: Digital Workshop
Hi,

Thank you for your enquiry.

You can count the elements of an array using the length command. For example:

Code:
myArray = new Array(1,5,2,4,3)
len = myArray.length


In this example, 'len' will equal 5 (as there are 5 elements in the array).

Kind regards,

_________________
Robin Garrett
Digital Workshop Technical Support


Top
 Profile Visit website  
 
 Post subject:
PostPosted: January 20th, 2005, 1:51 pm 
Offline

Joined: January 19th, 2005, 5:15 pm
Posts: 83
Location: Netherlands
Hello Robin,

Thanks for the quick answer. I tried .length, but not hard enough i see :-)
Thought .lenght was only for strings.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 56 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group