Dictionary/3000 Reference Manual (32244-90001)

210 Chapter6
The Dictionary DICTPDE Utility
>GENERATE ELEMENTS
TYPE
CUSTNAME = PACKED ARRAY[1..14] OF CHAR;
CUSTNUM : CUSTNAME;
The VAR declaration for the element CUSTNUM is generated as follows:
TYPE
CUSTNAME = PACKED ARRAY[1..14] OF CHAR;
VAR
CUSTNUM = CUSTNAME
Note that the code for the ELEMENT-REFERENCE is generated first as a TYPE
declaration.
The next example shows the code generated for a parent element. (This element has child
elements related to it.) In this example, the element SALES has the elements PRODUCT,
PRICE and PACKAGE related to it. These elements are defined in the Dictionary as:
PARENT-ELEMENT = SALES
ELEMENT-TYPE = X
ELEMENT-LENGTH = 50
CHILD-ELEMENTS = PRODUCT PRICE PACKAGE
ELEMENT-TYPE = X X X
ELEMENT-LENGTH = 12 28 10
The code for the parent element SALES is generated as follows:
>generate element
ELEMENT(S)> sales
TYPE
SALES =
RECORD
PRODUCT : PACKED ARRAY[1..12] OF CHAR;
PRICE : PACKED ARRAY[1..28] OF CHAR;
PACKAGE : PACKED ARRAY[1..10] OF CHAR
END;
Note that in this case the sum of the storage lengths for the child elements equals the
storage length for the parent element as defined in the Dictionary.
In the next example, code is again generated for a parent element. However, in this
example, the sum of the storage lengths for the child elements does not equal the storage
length for the parent element.
PARENT-ELEMENT = ADDRESS
ELEMENT-TYPE = X
ELEMENT-LENGTH = 48
CHILD-ELEMENTS = STREET NUMB