contents.gifprev1.gifnext1.gif

CREATE_ARRAY

Description:

CREATE_ARRAY creates an ARRAY structure. Arrays are one-dimensional lists of elements. nu/TPU arrays can contain static and/or dynamic lists. The static part of the array is created when you call CREATE_ARRAY with a size value passed as the first parameter. The optional second parameter can set the index of the first element to an integer value other than 1. All static element indexes are integer values. All the static elements returned by CREATE_ARRAY have a type of unspecified. Dynamic elements are created by normal nu/TPU assignment statements. The indices and elements of an array may be any valid nu/TPU data type with one restriction: Static indices must be numeric.

Compatibility: When using DEC TPU both ARRAY(INDEX) and ARRAY{INDEX} are valid, nu/TPU supports only the ARRAY{INDEX} format.

Syntax:

array := CREATE_ARRAY

array := CREATE_ARRAY ( SIZE )

array := CREATE_ARRAY ( SIZE, FIRST )

Examples:

MY$ARRAY := CREATE_ARRAY; ! Array with no indices

MY$ARRAY := CREATE_ARRAY (10, 0); !Array with 10 indices ranging from 0 to 9

WINDOW$STATS := CREATE_ARRAY (10, 0);

WINDOW$STATS{"TOP"} := GET_INFO (CURRENT_WINDOW, "TOP");

WINDOW$STATS{"BOTTOM"} := GET_INFO (CURRENT_WINDOW, "BOTTOM");

Errors:

TPU$_MAXVALUE First parameter must be less than 65,535.

TPU$_MINVALUE First parameter must be greater than 0.

Related Builtins:

DELETE

GET_INFO