Wherever dynamic access is valid, you can reference a field by using a string variable, constant, or literal in brackets. Each content-filled pair of brackets is equivalent to a dot followed by a valid identifier.
row Dictionary { lastname = "Smith" }; category, motto STRING; row["Record"] ="Reserved word"; row["ibm.com"]="Think!"; category = row["Record"]; motto = row["ibm.com"]
row.age = 20; row["age"] = 20;
Assume that you declared a record named myRecordVar01, which includes a field named myRecordVar02, and that myRecordVar02 is itself a record that includes the previous dictionary. A valid reference is as follows:
myRecordVar01.myRecordVar02.row.lastName
const SECOND STRING = "myRecordVar02"; const GROUP STRING = "row"; const LAST STRING = "lastName";
myRecordVar01[SECOND][GROUP][LAST]
The first symbol in a reference must always be a valid identifier, but in this case, dynamic access is in effect after that identifier.
myRecordVar01[SECOND].row[LAST]
myRecordVar01.myRecordVar02.myRecordVar03[3][2].myInt
const SECOND STRING = "myRecordVar02"; const THIRD STRING = "myRecordVar03"; const CONTENT STRING = "myInt";
myRecordVar01[SECOND][THIRD][3][2][CONTENT] myRecordVar01[SECOND][THIRD][3][2].myInt myRecordVar01.myRecordVar02.THIRD[3][2][CONTENT]
Related concepts
Abbreviated syntax for referencing fixed structures
Dynamic and static access
Function part
Parts
Program part
References to parts
References to variables in EGL
Scoping rules and "this" in EGL
Fixed structure
Typedef
Related tasks
Declaring variables and constants in EGL