Documentation Comments
Use this form to comment on this topic. You can also provide any general observations about the Online Documentation, or request that additional information be added in a future release.
Reality V15.0 ()
ENTER Statement (DataBasic) (m618703+enter_s.htm)
Transfers control one-way from one cataloged program to another cataloged program.
ENTER ctlgName
ENTER @ctlgVar
ctlgName The name of a cataloged program.
ctlgVar A variable containing the name of a cataloged program.
ENTER transfers control to a DataBasic program that has already been compiled and cataloged. The program executing the ENTER statement must also be cataloged.
All variables to be passed between programs must be declared in COMMON statements in the program transferring control and in the program being entered. All other variables are initialized when the program is entered.
You can ENTER a program that calls a subroutine or external function, but you cannot ENTER a program from a subroutine or external function, or invoke a subroutine or external function with the ENTER statement.
ENTER works faster than the CHAIN statement. However, if the programs are not cataloged, you must use CHAIN RUN, together with option 'I' if COMMON variables are to passed.
ENTER PGM1
Executes cataloged program PGM1. Any COMMON variables are passed to PGM1.
I=2 PROGRAM="PGM":I ENTER @PROGRAM
Executes PGM2 and passes any COMMON variables to PGM2.