Caché MultiValue Basic Reference
ENTER
[Back] [Next]
   
Server:docs2
Instance:LATEST
User:UnknownUser
 
-
Go to:
Search:    

Transfers control to an external subroutine.
Synopsis
ENTER name
Arguments
name Name of the external subroutine to call.
Description
The ENTER statement can be used to call an external subroutine. The external subroutine must have been compiled and cataloged. No parameters can be passed using ENTER; use CALL if you need to pass parameters to a subroutine. When ENTER is used to call an external subroutine, the RETURN statement within the external subroutine does not return control to calling program; use CALL if you need to return following a subroutine call.
ENTER calls the external subroutine without increasing the stack level. This can be useful when issuing a large number of calls without returning. Because ENTER is not increasing the stack level, a <FRAMESTACK> error cannot occur.
You can use name to specify the external subroutine either directly or indirectly:
You can also use the COMMON statement to make specified variables available to all external subroutines.
ENTER, CALL, GOSUB, and SUBR
The ENTER statement is used to call an external subroutine with no parameter passing or return, and without increasing the stack level. The CALL statement is used to call an external subroutine with parameter passing and returning. CALL increases the stack level.
The GOSUB statement is used to call an internal subroutine. The SUBR function is used to call an external subroutine that returns a value.
Examples
The following example uses ENTER to call an external subroutine:
Main
  x="Burma"
  PRINT x           ! Returns "Burma"
  ENTER ErrorSub
  PRINT x           ! Does not execute

ErrorSub
  PRINT "An error occurred"
  QUIT
See Also