omron — DOS program instruction

DOS program instruction DOS program instruction Syntax DOS string, error Function Execute a program instruction defined by a string expression. Usage Considerations Before the instruction is executed, the string must be translated from ASCII into the internal representation used by eV+. Thus, the instruction executes much more slowly than a normal program instruction. The string cannot define a declaration statement or most of the control structure statements. The DOS instruction is ignored if the string defines a comment line or a blank line. Parameters string String constant, variable, or expression that defines the program instruction to be executed.

The instruction may contain a label field (which is ignored) and may be followed by a standard comment field. Leading and trailing spaces and tabs are ignored. error Optional real variable that receives any parsing or execution error generated by the instruction. The value is set to 1 if the instruction succeeds. If the instruction fails, a standard eV+ error number is returned. If this parameter is omitted and an error occurs, execution of the program stops and the appropriate error message is displayed. Details The DOS (DO String) instruction provides a means for modifying a program on the fly.

That is, the embedded program instruction, which is defined by a string expression, is executed as though it had been entered in the program as a normal instruction. The instruction executes in the context of the current program. Thus, any subroutine argument, automatic variable, or local variable can be accessed. If a variable referenced in the instruction is not found in the current program context, the variable is assumed to be global. Any new variables that are created by the instruction (for eV+Language Reference Guide, v2.x, 18319-000 Rev A Page 183