Core Function UBound
From Sputnik Wiki
(Difference between revisions)
Line 33: | Line 33: | ||
<syntaxhighlight lang="sputnik"> | <syntaxhighlight lang="sputnik"> | ||
$array = array ("One", "Two", "Three"); | $array = array ("One", "Two", "Three"); | ||
− | println(" | + | println("Highest index is: " . UBound($array) ); |
</syntaxhighlight> | </syntaxhighlight> | ||
[[Category:Core Function]] | [[Category:Core Function]] |
Revision as of 15:12, 19 August 2013
UBound( <array/binary-array> )
Contents |
Description
Returns the index of the highest element in an array .
Parameters
array/binary-array
The array to use.
OR
The binary variable to use.
Return Value
Success - Returns the highest index in the array/binary-array.
Failure - Returns -1.
Remarks
Although this gets the highest index it may not get how many items there are in the array use Count( <array/binary-array> ) for that.
If you want the lowest index instead of the highest use LBound( <array/binary-array> ) for that.
Example
$array = array ("One", "Two", "Three"); println("Highest index is: " . UBound($array) );