Data Structures types must be defined before they can be used. Each Data Structure has a name and a list of members with their types. The name of the Data Structure and its members are case sensitive and must match the same conventions as entry names.
Data Structure types are declared using the keyword DATASTRUCTURE:
DATASTRUCTURE Name
BEGIN
members
END
Rules:
The DATASTRUCTURE statement defines the Data Structure and assigns it a name. After the definition variables can be declared which use the Data Structure type.
Every member of the Data Structure type has a type and a name. The type can be either another ITP type (including other Data Set types) or a ARRAY or MAP of variables of an ITP type.
type Name
MAP type Name
ARRAY type Name
ARRAY type Name [number] (* Optional number of elements -- is ignored *)
FIELDSET Name
FIELDSET Name DEFINED_AS OtherName
FIELDSET members can be optionally defined using the DEFINED_AS keyword. This keyword indicates that the member should be treated as a Field Set with the alternative name when constructing Content Wizards or inserting Text Blocks.
Rules:
It is also possible to define Data Structure members inline in the definition. This is described in Inline DATASTRUCTURE definitions.
Example
The following example defines the Data Structure type Relation with five members:
DATASTRUCTURE Relation
BEGIN
NUMBER CustomerNumber
NUMBER Age
FIELDSET Person
FIELDSET Partner DEFINED_AS Person
ARRAY FIELDSET Children DEFINED_AS Person (* Array of 'Person' Field Sets *)
END
Both the Partner member and every one of the elements in the Children array is treated as if it was a Person Field Set by the Content Wizard and Text Block handling. The model developer can differentiate between these members by using their member names.
Example
The following example defines the data structure type Policy:
DATASTRUCTURE Policy
BEGIN
TEXT PolicyNumber
NUMBER InsuredAmount
FIELDSET PolicyData
Relation Insured (* Data Structure *)
ARRAY Relation Benificiaries (* Array of Data Structures *)
END
Both the Insured and Benificiaries members have the previously declared Relation Data Structure type.