ENABLE Reference Manual

ENABLE ATTRIBUTES
TREE Attribute
Since the application is to display information about departments
and the employees assigned to those departments, "depart-box"
should be the parent box and "employ-box" the child box. The
join fields of these boxes are "dept-no" and "dept-num"
respectively.
To build a tree structure for this application, set a value for
the TREE attribute as follows:
1. Identify "depart-box" as being at the first level of the tree
structure:
SET APPL TREE (01 depart-box
Remember that you do not include LINK OPTIONAL with the box
at the first level of the tree structure.
"01" is an arbitrary choice for the level number of this box.
This level could be any value less than fifty, but must be
the lowest number in the tree value.
2. Identify "employ-box" as being at the second level of the
tree structure:
SET APPL TREE (01 depart-box
03 employ-box
Note that 03 can be used as the level for this box because
ENABLE does not require levels to be numbered consecutively.
3. Include LINK OPTIONAL with "employ-box." This option must be
included because "employ-box" is not at the first level of
the tree. Since the join field of "depart-box" is "dept-no"
and the join field of "employ-box" is "dept-num," LINK
OPTIONAL should appear as:
LINK dept-no TO OPTIONAL dept-num
| |
| join field of the child box
|
join field of the parent box
To complete the TREE attribute, you include LINK OPTIONAL
with the part of the TREE attribute that defines the level of
"employ-box" as follows:
SET APPL TREE (01 depart-box
02 employ-box
LINK dept-no TO OPTIONAL dept-num)
4-86