ArrayDictionary

The ArrayDictionary part gives row-oriented access to a set of arrays that are defined as columns; that is, you can use this part to access a series of arrays by retrieving the same-numbered element of each array. A set of elements that is retrieved in this way is itself a dictionary, with each of the original array names treated as a key that is paired with the value contained in the array element.

The ArrayDictionary part is always available; you do not define it, but simply declare a variable based on it.

The following figure illustrates an ArrayDictionary with a declaration that includes arrays that are named ID, lastName, firstName, and age. You can also think of an array dictionary as an array of one-dimensional dictionaries; the ellipse encloses such a dictionary that includes the following key/value entries:
  ID = 5,
  lastName = "Twain",
  firstName = "Mark",
  age = 30
Illustration of an array dictionary
The following code shows the declaration of a list of arrays, followed by the declaration of an array dictionary that uses those arrays:
  ID INT[] = [1,3,5,9];
  lastName STRING[] = ["Cervantes", "Moliere", "Twain", "Tolstoy"];
  firstName STRING[] = ["Miguel", "", "Mark", "Lev"];
  age INT[] = [90, 29, 30, 55];

  myRows ArrayDictionary
  {
    col1 = ID,
    col2 = lastName,
    col3 = firstName,
    col4 = age
  }; 
You cannot use the ArrayDictionary syntax to update a value or to change any characteristic of the array dictionary itself. You can retrieve any value from the array dictionary by specifying a row number and column name, as in the following equivalent examples:
  cell INT = myRows[2]["col1"];

  cell INT = myRows[2].col1; 
It might be useful, however, to isolate a particular dictionary and then a particular field (a key/value entry) in that dictionary. First, declare a dictionary and assign an array dictionary row to that dictionary, as in this example:
  row Dictionary = myRows[2];
Next, declare a variable of the appropriate type and assign an element to that variable, as in either of these examples:
  cell INT = row["col1"];

  cell INT = row.col1;

EGL Console UI uses array dictionaries for screen displays where you have both rows and columns of data. For example, each row (dictionary) might represent a transaction on a point of sale terminal.

An ArrayDictionary part does not have any of the functions or properties of either an Array or a Dictionary.

Compatibility considerations

Table 1. Compatibility considerations
Platform Issue
JavaScript generation

ArrayDictionary is not supported.


Feedback