For BBj-specific information, see ENTER
Verb - BBj.
Use the ENTER verb in a public program to link to the arguments passed from the CALLing program. Each item in the ENTER statement must be a simple variable or an array in the form X[ALL], where X is an array name. Each variable in the ENTER list links to the corresponding argument in the caller's CALL list.
For example, the following line is in the calling program:
1000 CALL "pubprog",A,B$,2,"string"
The following line is in the CALLed public program:
0050 ENTER W,X$,Y%,Z$
After PRO/5 executes the ENTER verb, the CALLed variables W, X$, Y%,
and Z$ have the values of the arguments from the CALL statement; however,
W and X$ are reference arguments. Changing W in the public program changes
A in the calling program. Changing X$ in the public program changes B$
in the calling program. Changing Y% and Z$ has only a local effect on
the public program because they are value arguments. The CALL statement
determines the mode of each argument. See CALL
for additional information.
The same simple variable cannot appear more than once in an ENTER statement. If an ENTER argument is executed before the ENTER is executed, the old value is lost following execution of the ENTER. PRO/5 issues an error if the number and type of arguments in the ENTER do not match the arguments in the corresponding CALL.
NOTE: An integer constant matches either an integer variable, or a numeric variable. Integer variables and regular numeric variables are considered different types in an ENTER statement. If an error occurs during an ENTER, all arguments resolved up to the error have been successfully linked and can be used later in the program. The other arguments are undefined. Once an ENTER has been attempted, it cannot be retried.
If the ENTER statement has no argument list, the public program shares ALL variables with its caller. An error is issued if the caller tries to pass arguments through the CALL statement, or if the public program has created any of its own data prior to the ENTER.
A CALL to a program can only execute one ENTER verb. ENTER is not permitted in console mode.
See the ADDR, CALL, DROP, and EXIT for additional information.
0100 ENTER A,B,C$,X[ALL]