Difference between revisions of "Getarraysize"

From Hercules Wiki
Jump to: navigation, search
(Created page with "== Syntax == * getarraysize(<array name>) == Description == This function returns the number of values that are contained inside the specified array. Notice that zeros an...")
 

Latest revision as of 19:43, 13 January 2013

Syntax

  • getarraysize(<array name>)

Description

This function returns the number of values that are contained inside the specified array. Notice that zeros and empty strings at the end of this array are not counted towards this number.

Examples

setarray @array[0], 100, 200, 300, 400, 500, 600;
set @arraysize, getarraysize(@array);

This will make @arraysize == 6. But if you try this:

setarray @array[0], 100, 200, 300, 400, 500, 600, 0;
set @arraysize, getarraysize(@array);

@arraysize will still equal 6, even though you've set 7 values.