AMT Datasouth PAL User Manual

Page 113

Advertising
background image

107

get

get

Description

Recover data from a composite or string object.

Usage

AnyArray IndexInt

get

ElementAny

AnyDict KeyAny

get

ValueAny

AnyStr IndexInt

get

CharInt

AnyArray

Array. Array object containing desired object to recover.

AnyDict

Dictionary. Dictionary object containing desired object to recover.

AnyStr

String. String object containing desired character to recover.

IndexInt

Integer. When used with AnyArray, index of data object within array. Arrays
begin with index zero. When used with AnyStr, index of character within string.
Strings begin with index zero.

KeyAny

Any. Key associated with value object within dictionary.

ElementAny

Any. Object from index IndexInt within array AnyArray.

ValueAny

Any. Object associated with key KeyAny within dictionary AnyDict.

CharInt

Integer. Integer value of character from index IndexInt within string AnyStr.

Comments

In the first variant, the operator recovers the object at index IndexInt within the array AnyArray.
Array indexes range from zero to N-1, where N is the number of elements in the array. The op-
erator pushes a duplicate of the desired object onto the operand stack. For composite objects, the
duplicate object shares its data with the original object in the array.

In the second variant, the operator recovers the object associated with KeyAny within the dic-
tionary AnyDict. The operator pushes a duplicate of the desired object onto the operand stack. For
composite objects, the duplicate object shares its data with the original object in the dictionary.

In the third variant, the operator recovers the character at index IndexInt within the string AnyStr.
String character indexes range from zero to N-1, where N is the number of characters in the string.
The operator pushes the integer value of the desired object onto the operand stack. PAL uses
ASCII encoding for characters within strings.

Hints

The get operator will generate an error if KeyAny does not exist within AnyDict. If the pro-
grammer does not know whether or not KeyAny will exist within AnyDict, the programmer should
use the known operator to test for KeyAny.

Advertising