ProvideX V8.20 > Language Reference > 2. Directives
118
ENTER Directive
          Specify Arguments
Format
ENTER [arglist][,ERR=stmtref]
Where:
arglist
Variables in to receive arguments passed from the calling program. Use:
· a comma-separated list of simple numeric and/or string variables, not
subscripts/substrings,
· IOL=ioltref (e.g., ENTER IOL=8000), or
· a complete numeric array (e.g., ENTER ARRAY_NAME{ALL})
stmtref
Program line number or label to transfer control to.
Restrictions: You can only use this directive in called programs (subprograms).
Description
Use ENTER in a called program to define the total number, relative positions and
types of variables it will receive. These are arguments passed to the subprogram via
the calling program's CALL statement.
The variables in the calling program's CALL statement must match those in the
subprogram ENTER statement exactly. That is, each argument in the CALL statement
must correspond by position and in type (numeric or string) to a variable in the
ENTER statement. Otherwise, ProvideX returns Error #36: ENTER parameters
don't match those of the CALL.
If the calling program is passing a complete numeric array, the name of the array
must be specified, followed by {ALL} in both the ENTER and CALL statements
(curly brackets are part of the syntax).
Where a CALL statement specifies a simple variable, all changes made to the variable
ENTERed in your subprogram will be reflected in the calling program when the
subprogram terminates. You can protect a simple variable in either the CALL or
ENTER statement by placing the argument inside parentheses ­this turns the variable
into an expression, which has the effect of making it read only.
String templates cannot be passed if they are defined prior to the ENTER statement in
the called program.
See Also
CALL Transfer to Subprogram, p.40
Called Procedures, User's Guide.
Examples
In calling program:
0170 CALL "SUBR",LEN(A$),N,A$,T{ALL}
In subprogram "SUBR":
0020 ENTER A,B,Z$,N{ALL}