ENABLE User's Guide
 CREATING AND RUNNING A MULTIFILE APPLICATION
 Associating and Linking Boxes
TREE(01 employee
 02 dependents LINK empnum TO OPTIONAL emp-no)
S5044-024
employee
 empnum
 empname
 • • •
Level 1
Dependents
 dep-key
 emp-no
 dependent-no
 • • •
Level 2
Link that Connects Boxes
 Figure 5-5. Sample Tree Structure
 What Is a Link?
 A link is the portion of the tree structure that establishes a
 logical connection between two boxes. A tree structure might
 have many links that connect a box to several other boxes;
 however, only two boxes are connected by any single link.
 ENABLE provides a special kind of link called a LINK OPTIONAL.
 When you establish a LINK OPTIONAL between two boxes, you define
 the order in which the application can read or insert records for
 the boxes. This order establishes a dependency between the
 records associated with both. With a LINK OPTIONAL, the
 application must use the join-field value of a record from one
 box to read or insert a record for the other box. Access to a
 record in the second box depends upon the presence of a record
 that has a matching join-field value in the first.
 Because this dependency is similar to the relationship that
 exists between a parent and a child, one of the boxes connected
 by a LINK OPTIONAL is called a parent box and the other is called
 a child box. You can read or insert a record for a child box
 only if you have already read or inserted a record for the parent
 box.
 5-11










