Lesson 6: RECURSION Option [ MPE V to MPE XL: Getting Started ] MPE/iX 5.0 Documentation
MPE V to MPE XL: Getting Started
Lesson 6: RECURSION Option
Experienced users of UDC files will recall that in MPE V/E, a UDC can
only call another UDC if the second UDC comes after the first in the UDC
directory.
The new MPE XL RECURSION option allows the flexibility of having one UDC
call upon another that may be cataloged before it. With the RECURSION
option, the search for a UDC starts with the first UDC in the first UDC
file cataloged on the system.
Consider how cataloging is done in MPE V/E and how flexible it is in MPE
XL. In both of the following examples, the UDC GETB, in the UDC file
UDCFILE3, calls upon the UDC B in the file UDCFILE1.
Note where UDCFILE3 must be cataloged in MPE V/E. In MPE XL, UDCFILE3 may
be cataloged either before or after the UDC B as long as OPTION RECURSION
has been invoked. The following example shows a UDC file in which a UDC
calls upon another UDC that precedes it.
Execution of the UDC ED would result in the following:
______________________________________________________________________
| |
| |
| :ED |
| |
| FILENAME |
| |
| APPLE BEATLES DIANA EMILY NORM... |
| |
| HP32201A.07.17 EDIT/3000 WED,MAR 9,1988,10:16AM |
| (C) HEWLETT-PACKARD CO. 1985 |
| / |
| |
______________________________________________________________________
NOTE The RECURSION option is only effective for the UDC in which it is
specified. Other UDCs in the file are not affected.
Note also that recursion is an unchangeable characteristic of
command files; RECURSION and NORECURSION are simply ignored in
command files.
OPTION NORECURSION is the default in UDCs and is consistent with MPE V/E.
When invoked it allows a UDC to call other UDCs only if they follow the
calling UDC in the catalog.
Exercise
15. Study the following MPE XL UDC file. Indicate how you would change
this file to have the UDC SO call upon and execute the UDC ST
without changing the order in which they now appear:
ST
showtime
**
SM
showme
**
SO
showout
**
Additional Information. Because recursion allows two UDCs to call each
other and enables a UDC to call itself, limitations have been put in
place to prevent endless loops (for example, two commands calling each
other over and over again without end).
For example, consider a UDC called GETA:
GETA
Option Nolist
Option Recursion
SHOWTIME
GETA
**
The maximum number of times that GETA can call itself is 30 times. When
that maximum is reached, the system interrupts the process with an error
message. This safeguard may be helpful to you in debugging your user
commands.
NOTE Experienced creators of UDCs will notice in the GETA example that,
unlike MPE V/E, in which only one option line is allowed after the
header, multiple option lines are allowed in MPE XL at the
beginning of a UDC, following the header.
MPE/iX 5.0 Documentation