ENTER

ENTER


END CASE Index Level EQ
Syntax ENTER cataloged-program-name
ENTER @variable  
Category BASIC
Type Statement
Description transfers control to another cataloged FlashBASIC 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 FlashBASIC 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.
Options
See Also PRECISION DATA EXECUTE CHAIN CALL TCL SUBROUTINE statements & functions COMMON
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 example below, the program name is stored in a variable.

program first.prog
common x,y,z
x = 5
pgmname = "second.prog"
enter @pgmname
Warnings "enter" must not be used from a subroutine.
Compatibility D3 7.0 AP R83
END CASE Index Level EQ