| System Functions |
|
| Format | 1. Evaluate
numeric string expression: EVN( var$ [ ,
val ] [,ERR=stmtref]) 2. Evaluate numeric expression: EVN( =numexpr [ , val ] [,ERR=stmtref])
|
||||||||
| Returns | Returns the value of the evaluated numeric expression. | ||||||||
| Format 1 | This format
of the EVN( ) function evaluates and
returns the numeric value of a numeric variable or
computed expression. Use this function to process a stored or computed expression and obtain its current value. Any error (syntax or run-time error) will be trapped by the function and can be processed with by the ERR= option. If the default value (val) is supplied, it will be returned if the expression results in an error. |
||||||||
| Format 2 | This format
of the EVN( ) function simply returns
the value of the expression supplied in numexpr.
This format is used when you have a constant expression
but want to place an error trap around the expression. If the default value (val) is supplied, it will be returned if the expression results in an error. If no default value is supplied and an error occurs, the ERR= trap will be taken.
|
||||||||
| See Also | EVS( ) Evaluate String
Expression VIS( ) function and VIN( ) function - obtain value of variable |
||||||||
| Examples | In this
example, EVN("GL_"+X$) builds the variable name
based on user input and returns the value stored in the
variable. 00010 GL_YTD=10000,GL_MTD=3000,GL_CUR=10 00020 input "Which field (YTD,MTD,CUR):",X$ 00030 print evn("GL_"+X$):"$###,##0.00-" 00040 stop For the example above, if the user's input is CUR for X$, the variable name will be GL_CUR. If the value stored in GL_CUR in the current record is, for example, 9999.63, ProvideX prints that value (using the format mask) as $9,999.63. In this example, EVN(V$)will print the numeric value stored in V$ for the current record of logical file number RPT_FN. 0090 K$=KEY(RPT_FN); IF K$(1,12)<>RPT_ID RETURN 0100 READ (RPT_FN)L,C,V$ 0110 PRINT (RPT_FN) @(C,L),EVN(V$) 0120 GOTO 0090 |