Siebel eScript Language Reference > Methods Reference > Array Methods >

Get Largest Array Index Method


The Get Largest Array Index method returns the number of the highest index that the array contains, plus 1. This return value does not necessarily include the actual number of elements in an array because Siebel eScript does not require elements to be contiguous.

Format

arrayName.length

Example

The following example includes two arrays:

var ant = new Array;     var bee = new Array;
ant[0] = 3               bee[0] = 88
ant[1] = 4               bee[3] = 99
ant[2] = 5
ant[3] = 6

The length property of ant and bee is equal to 4 even though ant includes twice as many array elements as bee. To remove array elements, you can write code that modifies the value of the length property. For example, if you write code that modifies ant.length to 2, then ant loses any elements that occur after the first two elements, and Siebel CRM loses the values that it stored at the other indices. If you set bee.length to 2, then bee includes the following elements:

  • bee[0], with a value of 88
  • bee[1], with an undefined value
Siebel eScript Language Reference Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Legal Notices.