EVAL

The EVAL command is used to evaluate an EASI subprogram provided as a string argument. This accomplishes approximately the same thing as writing the string expression to a file and then running it using the RUN command.

 EVAL prog_line [ONERROR statement]

 prog_line: string expression to be evaluated as a subprogram.

The subprogram must be a single string expression (not a multi-line expression) but it may contain many logical lines separated by backslash characters. An ONERROR clause may be added to perform a statement if an error occurs.

The EVAL command exists so that procedures can easily evaluate arbitrary expressions created at run time. The evaluated sub-expression has its own variable scope, similar to a subprogram invoked with CALL or RUN. No value is returned, so results are normally exported only via side-effects.

Example:

A user enters a parameter name, and the value is extracted and assigned to NUM.

 local string var_name, int error

 input "Parameter Name: " var_name

 error = 0
 EVAL "NUM1 = "+var_name ONERROR error = 1
 if( error = 1 )then
   print var_name+" is not a legal numeric parameter."
 else
   print var_name+" value is:",num1
 endif

© PCI Geomatics Enterprises, Inc.®, 2026. All rights reserved.