Record myRecordPart type serialRecord { fileName = "myFile" } 10 myTop; 20 myNext; 30 myAlmost; 40 myChar CHAR(10); 40 myChar02 CHAR(10); end
Assume that a function uses the record part myRecordPart as the type when declaring a variable named myRecordVar.
myRecordVar.myTop.myNext.myAlmost.myChar
That reference is considered to be fully qualified.
myRecordVar.myChar
That reference is considered to be partially qualified.
You cannot partially qualify a field name in any other way. You cannot include only some of the field names that are between the variable name and the field name of interest, for example, nor can you eliminate the variable name while keeping any of the names of structure field that are superior to the field of interest. The following references are not valid for the earlier example:
// NOT valid myRecordVar.myNext.myChar myRecordVar.myAlmost.myChar myNext.myChar myAlmost.myChar
myChar myChar02
Those references are considered to be unqualified.
record myRecordPart type serialRecord { fileName = "myFile" } 10 person; 20 *; 30 streetAddress1 CHAR(30); 30 streetAddress2 CHAR(30); 30 nation CHAR(20); end
// NOT valid myRecordVar.*.streetAddress1 myRecordVar.*.streetAddress2 myRecordVar.*.nation
record myRecordPart 10 myTop; 20 myNext; 30 nation CHAR(20); end
An unqualified reference to nation refers to the primitive variable, not to the structure field.
record myRecordPart 10 myTop; 20 myNext; 30 nation CHAR(20); end
An unqualified reference to nation fails because nation could refer either to the primitive variable or to the structure field. You can reference the structure field, but only by qualifying the reference.
For additional rules, see Arrays and Use declaration.
Related concepts
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