More on Arrays
Previous Topic  Next Topic 

The TE language allows for var type and int type arrays of up to 256 elements long.   The declaration of an array requires that the first and last index values be specified.   For example:


var a[1..20];


Defines an array with indexes ranging from 1 through to 20.         Any attempt to access an element beyond this range will result in an error at runtime being written to the log.     An attempt to access an array element out of range will result in the empty string “” being returned.


var a[1..20];


b=a[0];     // b will be set to "" and an error will appear in the error log screen.

c=a[21];     // c will be set to "" and an error will appear in the error log screen.


The maximum index range allowed in the declaration of and array is 0 through to 255.    Also the lower index range must be less than the upper index range.  Therefore the following declarations all illegal:


var a[-1..20];      // Illegal: Lower index less than 0

var b[25..256];   // Illegal: Upper index greater than 255

var c[50..1];      // Illegal: Upper index range less than lower