basic.enter Statement/BASIC Program

basic.enter

Command basic.enter Statement/BASIC Program
Applicable release versions: AP, R83
Category BASIC Program (486)
Description transfers control to another cataloged Pick/BASIC program.

The program that is executed using the "enter" statement must be a cataloged verb in the current md, and may not be a subroutine. The program executing the "enter" statement need not be cataloged.

All variables passed between programs must be declared by a "common" declaration in all program segments that are to be entered. All other variables are initialized upon entering the program. The common area grows or shrinks if the size is different between programs.

Control does not return to the original program. In this way, "enter" is much like "chain" except that "enter" must be used to activate another Pick/BASIC program and nothing else.

The "at sign" (@) indicates that the program name is stored in the specified program variable. Without the "@", the "variable" name is taken literally.
Syntax enter cataloged-program-name
enter @variable
Options
Example
program first.prog
common x,y,z
x = 5
enter second.prog

program second.prog
common x,y,z
print x
stop

 In the above example, a "5" would be output.  In the exmple below, 
the program name is stored in a variable. 

program first.prog
common x,y,z
x = 5
pgmname = "second.prog"
enter @pgmname
Purpose
Related basic.precision
basic.data
basic.execute
basic.chain
basic.call
basic.tcl
basic.subroutine
basic.statements
basic.common