Siebel eScript Language Reference > Methods Reference > Global Methods >

Set Array Length Method


The Set Array Length method sets the first index and length of an array. It sets the length of the array argument to a range that the minIndex argument and the length argument define.

If you specify all three arguments for this method, then the following occurs:

  • The minIndex argument is the minimum index of the resized array.
  • The length argument is the length of the resized array.
  • If an element resides outside the length of the resized array, then that element becomes undefined.

If you only specify two arguments, then this method uses the second argument as the length argument and sets the minimum index of the resized array to 0 by default.

This method is unique to Siebel eScript. For more information, see Make Sure the JavaScript Interpreter Can Run a Function.

Format

setArrayLength(array[, minIndex], length])

Table 84 describes the arguments for the Set Array Length method.

Table 84. Arguments for the Set Array Length Method
Argument
Description

array

The name of the array whose length this method must set.

minIndex

The index of the lowest element where this method starts counting. This value must be 0 or less.

If you use ST eScript code, then it is not appropriate to use the minIndex argument. If you use ST eScript code, then this code restricts the minimum index to zero only and assigns it by default.

length

The length of the array.

Use Caution If You Define an Array That Includes a Negative Index

Use caution if you defined an array that includes a negative index.

CAUTION:  ST eScript code does not support a negative array index. If you define an array that includes a negative index, and if you use T eScript code to define this array in a Siebel application prior to release 7.8, then you must redefine the index range for this array and any references according to index values. As an alternative to using the Set Array Length method to set the array length, you can use the length property of the array object.

Related Topics

For more information, see the following topics

Siebel eScript Language Reference Copyright © 2015, Oracle and/or its affiliates. All rights reserved. Legal Notices.