ENTER Statement

The ENTER statement may be used to transfer permanent control to another program.

Format

ENTER item-ID

ENTER @var

Parameter(s)

item-ID

item-ID of the program to be entered.

@var

var is a variable which has been assigned the item-ID of the program to be entered.

Description

The ENTER statement transfers program control from the calling program to another program. Program sequence does return to the calling program. For this reason, the ENTER statement should not be used within a subroutine, nor should it be used to call a subroutine.

Parameters to be passed between programs must be declared through COMMON statements in both programs. All other variables is initialized upon entering the new program.

Example

In this application the user is prompted for the program to enter, and then the ENTER statement is used to transfer control to the appropriate program.

PRINT "WOULD YOU LIKE TO:"

PRINT " " , "1. EDIT AN EXISTING ITEM"

PRINT " " , "2. CREATE A NEW ITEM"

PRINT " " , "3. DISPLAY AN EXISTING ITEM"

PRINT " " , "(ENTER ANY OTHER PROGRAM)"

PRINT

PRINT "ENTER 1, 2 OR 3":

INPUT ANSWER

BEGIN CASE

   CASE ANSWER = 1

      ENTER EDIT.ITEM

   CASE ANSWER = 2

      ENTER CREATE.ITEM

   CASE ANSWER = 3

      ENTER DISPLAY.ITEM

   CASE 1

      ENTER @ANSWER

END CASE

See Also

Statement and Function Reference