Siebel eScript Language Reference > Siebel eScript Commands > The Global Object >

getArrayLength() Method


This function returns the length of a dynamically created array.

Syntax

getArrayLength(array[, minIndex])

Parameter
Description

array

The name of the array whose length you wish to find

minIndex

The index of the lowest element at which to start counting

Returns

The length of a dynamic array, which is one more than the highest index of an array.

Usage

Most commonly, the first element of an array is at index 0. If minIndex is supplied, then it is used to set to the minimum index, which is zero or less.

This function should be used with dynamically created arrays, that is, with arrays that were not created using the Array() constructor and the new operator. The length property is not available for dynamically created arrays. Dynamically created arrays must use the getArrayLength() and setArrayLength() functions when working with array lengths.

When working with arrays created using the Array() constructor and the new operator, use the length property of the arrays.

CAUTION:  The ST eScript engine does not support negative array indices. If you defined arrays with negative indices using the T eScript engine in Siebel Business Applications releases prior to 7.8, then you must redefine their index ranges and any references based on index values.

CAUTION:  The getArrayLength() function is unique to Siebel eScript. Before using it, confirm that the JavaScript interpreter that will run the script supports Siebel eScript functions. Avoid using this function in a script that may be used with a JavaScript interpreter that does not support it.

See Also

The Array Constructor in Siebel eScript
Array length Property
setArrayLength() Method

Siebel eScript Language Reference