basic.enter

Statement/BASIC Program, Releases: AP and R83

Transfers control to cataloged program.

Syntax

enter cataloged-program-name enter @variable

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.

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

See Also

Command Name Type Description
basic.precision Statement Defines precision for calculations.
basic.data Statement Stacks strings for subsequent input(s).
basic.execute Statement Performs TCL command expression.
basic.chain Statement Transfers control to executable TCL expression.
basic.call Statement Calls external Pick/BASIC subroutine.
basic.tcl Statement Performs TCL command expression.
basic.subroutine Statement Defines program as external subroutine.
basic.statements Definition Definition of statements and functions.
basic.common Statement Declares common variables.

User Comments

What do you think?

Share your experience or ask a question by using the form below.

Login to leave your comments.