Back Previous Next


Linguist basic package - index

Syntax:

   index {variable} to {value}

Keyword handler:

   net.eclecity.linguist.basic.keyword.BasicKIndex.class

Runtime handler:

   net.eclecity.linguist.basic.handler.BasicHIndex.class

Function:

A Linguist language does not implement arrays in the usual manner, with constructs such as Sizes(3). Instead, a special construct is used. To access an array element, index to the item required and use the array as if it were a normal simple variable of its type. Each variable has its own index value that is maintained until explicitly changed. Ordinary variables are unaffected.

Be careful if your script uses multiple threads (e.g. fork, after, every and wait). There is only one index per variable and its value may be changed unexpectedly. The safest technique is to assume it to be invalid and always set it explicitly immediately before use.

Example(s):

   index MyArray to 14
   index BigArray to N


Back Previous Next iate