122
EXECUTE Directive
Execute Basic Instruction
Format
EXECUTE statement$[,ERR=stmtref]
Where:
statement$ Character string to be processed by the system as if entered in
Command mode. String expression.
stmtref
Program line number or label to transfer control to.
Description
Use EXECUTE to embed Command mode statements directly into a program. A
typical use of this directive is to modify the current program dynamically. When
used in a compound statement, EXECUTE must be the last directive in the line.
Note: By default ProvideX changes the current program. If the EXECUTE directive
starts with a line number, ProvideX modifies the current program and the line becomes
part of the current program, possibly overwriting the existing code. However, if the
system parameter 'EX' is on, it modifies the program at level 1 (the main level).
Note: Under WindX, you can use EXECUTE "[WDX]..." to encapsulate a directive
Examples
0010 LET X$=LST(PGM(TCB(4)+1));EXECUTE X$(5),ERR=*END
0100 IF WDX THEN EXECUTE "[WDX]SET_PARAM 'SD'"