Core Function UBound

From Sputnik Wiki
Jump to: navigation, search
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) );
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox