ARRAY

ARRAY defines an array list of variables. Elements of an ARRAY are accessed by their index number.

The first element of the ARRAY has index 1.

The following restrictions apply to ARRAY:

  • The maximum index allowed is 2^30.
  • The total size of all ARRAYs in a Template script grows as required and is limited by the amount of memory available.

The following is an example of the ARRAY declarations.

ARRAY TYPE array_name 
ARRAY TYPE array_name [ formula ] 

The restrictions list is as follows:

  • TYPE can be BOOL, NUMBER, TEXT, FIELDSET, or any data structure TYPE.
  • The ARRAY name is limited to lowercase characters, digits, and underscores. Spaces are not allowed.
  • The name must be unique in the scope it is declared in.
  • The formula must be of TYPE NUMBER. This determines the initial number of elements in the ARRAY. If the size is omitted, ARRAY is initialized with 0 elements.
  • ARRAY variables must be declared before they are used.
  • ARRAY variables can be used wherever regular variables of the same TYPE can be used.

ARRAY BOOL valid_numbers [ 1000 ] 
ARRAY NUMBER hour_rates [ 5 ] 
ARRAY TEXT customer_names