Dynamic and static access

EGL resolves a variable reference by static or dynamic access:
Consider an example in which the values in a dictionary include a fixed record and a non-fixed record:
  // a fixed record part
  Record myFixedRecordPart type=serialRecord
    {
      fileName = "myFile"
    }
    10 ID INT;
    10 Job CHAR(10);
  end

  // a record part (not fixed)
  Record myDynamicRecordPart type=basicRecord
    ID  INT;
    Job CHAR(10);
  end

  Program myProgram 

    dynamicPerson myDynamicRecordPart;
    myFlexID INT;

    fixedPerson myFixedRecordPart;
    myFixedID INT;

    Function main()

      dynamicPerson.ID = 123;
      dynamicPerson.Job = "Student";

      fixedPerson.ID = 456;
      fixedPerson.Job = "Teacher";

      relationship Dictionary 
      { 
        dynamicRecord=dynamicPerson,
        staticRecord=fixedPerson
      };
      end
    end
  end
The following rules apply:

Dynamic access is valid in assignments (on the left- or right-hand sides); in logical expressions; and in the statements set, for, and openUI.

Related concepts
Bracket syntax for dynamic access
Dictionary
Program part
References to variables in EGL
Typedef

Related tasks
Declaring variables and constants in EGL

Related reference
Assignments
Logical expressions
Primitive types
set

Feedback
(C) Copyright IBM Corporation 2000, 2005. All Rights Reserved.