Link Order (Magic xpa 3.x)
The Link is part of the data view definition, and therefore the Link operations are included in the Data View Editor. The minimal configuration of operations for a link consists of the following:
-
Link operation to specify which database table must be linked, which Link type, and by which index.
-
Columns, virtual variables, or parameters, with Locate lower/upper expressions to select the linked file index segments and to define the Link criteria using Locate expressions for each index segment.
-
End Link definition to terminate the link's specifications.
The creation of the minimal Link configuration is a semi-automatic feature of Magic xpa. Once you have selected a Link definition, Magic xpa generates a matching End Link operation immediately after it. Further, once you have selected a file to link to and an index to be used as the Link Index to the file, Magic xpa creates a set of variables between the Link and End Link definitions, corresponding to every Index segment of the specified index. For example, if the access Index used contains two Index segments, two variable entries are automatically created following the Link definition, each selecting an Index segment of the specified link Index. To complete the link specification, you just have to define Locate expressions for each Index segment.
If you change the Index specified for the linked file, Magic xpa creates a new set of variable entries for the new index segments.
To use the link to implement table lookup and to allow the task to refer to other variables belonging to the linked file, these variables must be defined between the Link and End Link definitions. The variables are joined to the record data view.
You cannot nest one link inside another link, even if the Index value used to establish the second link is selected by a variable defined for the first link. In such a case, create a new link immediately after the first one, and use the linked variables for the locate expression of the index segments. The result is similar to nesting the two links.