Understanding dictionaries
This is an introduction to dictionaries.
Dictionaries can store an unordered collection of elements, that will be accessed by key string, rather than by index as in arrays.
Dictionaries are used to implement a hash map (a.k.a. associative array).
The keys must be character
string:
DEFINE dict DICTIONARY OF INTEGER
LET dict["abcdef"] = 999
Dictionary elements can be of simple built-in types such as INTEGER
, VARCHAR(n)
, RECORD
structured types, or user-defined types. A dictionary can also be defined with
built-in classes, imported module classes (from the Web Services extensions for example), or Java
classes.