Execute. DORIC 9.65, INFO-Text software
Reklama
Reklama
EXECUTE
EXEC
UTE DF_item system_variable literal
passes the value of a specified data file item or system variable to
INFO to execute as an INFO command.
arguments notes
DF_item is an item in an INFO data file containing a valid
INFO command.
system_variable is one of the INFO system character variables containing a valid INFO command.
literal is a string containing a valid INFO command
An unqualified EXECUTE will execute the contents of the system variable $CHR1.
When used interactively, the specified item or system variable must contain a valid interactive command. INFO reads the INFO command only from the first 200 characters of the specified item or $CHR# system variable.
An EXECUTE command used in a program is decoded when the program is executed, because INFO does not know the contents of the stored command entry until the program is actually executing.
Do not use the following commands with EXECUTE:
ALTER EXECUTE REDEFINE
COPY EXTERNAL RELATE
DEFINE GET SELECT
ERASE MODIFY TAKE
In any section of a program (odd- or even-numbered), you cannot use the EXECUTE command to perform any command that would normally be invalid in a program, or any of the following commands that are normally valid in a program:
DO...DOEND FIRST
DONE GOTO
LABEL
PROGRAM
IF...ENDIF
INFO Reference Manual Commands 215
EXECUTE discussion
In even-numbered program sections, you cannot use
EXECUTE to perform the command NEXT.
The EXECUTE command passes the value of the specified data file item or system variable to INFO to execute as an INFO command. The specified value must have been previously stored in the item or system variable.
The length of the value that is interpreted as an INFO command is determined by the defined width of the data file item or by the formatted width of the system variable.
The value interpreted as a command must be appropriate for the environment in which the EXECUTE command is performed; otherwise, the results of executing the stored value as an INFO command can be unpredictable, and almost certainly wrong.
Also remember that all rules regarding odd- and evennumbered program section processing apply for the stored command. For example, if you issue the EXECUTE command in an odd-numbered program section, and if the stored command is an active INFO command, the stored command processes the entire selected set.
example
ENTER COMMAND >FORMAT $CHR1,40,C
ENTER COMMAND >FORMAT $CHR6,40,C
ENTER COMMAND >MOVE 'RUN P.MAIN.MENU' TO $CHR1
ENTER COMMAND >MOVE 'REPORT R.YTD.SALES Y 60' TO $CHR6
ENTER COMMAND >EXEC $CHR6
ENTER COMMAND >EXEC
By default, INFO executes as a command the value in
$CHR1
216 Commands INFO Reference Manual
Pobierz
Reklama