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

setArrayLength() Method


This function sets the first index and length of an array.

Syntax

setArrayLength(array[, minIndex], length])

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; must be 0 or less.

NOTE:  This parameter can be used, but is not meaningful, if you use the ST eScript engine. When using this engine, the minimum index is restricted to zero only, and is assigned by default.

length

The length of the array

Usage

This function sets the length of array to a range bounded by minIndex and length. If three parameters are supplied, minIndex is the minimum index of the newly sized array, and length is the length. Any elements outside the bounds set by minIndex and length become undefined. If only two parameters are passed to setArrayLength(), the second parameter is length and the minimum index of the newly sized array is 0 by default.

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. An alternative to using setArrayLength is to set array lengths with the length property of the Array object.

CAUTION:  The setArrayLength() 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.

For more information on implementing the Siebel scripting engine, see Using Siebel Tools.

See Also

getArrayLength() Method
Array length Property

Siebel eScript Language Reference