INCLUDE command

From m204wiki
Revision as of 16:11, 22 March 2017 by ELowell (talk | contribs)
Jump to navigation Jump to search

Summary

Privileges
Any user
Function
Executes a procedure

Syntax

INCLUDE [procnumber | procname] [delimiter response [delimiter response]...]

Where:

procnumber is the number of an existing temporary procedure; it can be zero or a negative number.
procname is the name of an existing procedure.
delimiter is one of the following characters:
Character name Keyboard display
Blank
Comma ( , )
Equal sign ( = )
Left parenthesis ( ( )
Right parenthesis ( ) )
response is a dummy string or $READ function response. Any number of responses can be specified on a command line, separated by delimiters. If dummy string and $READ responses are specified on the same command line, dummy string responses must appear first.

Example

INCLUDE INCLUDE ACCOUNT, OK, NA, DK

Usage notes

The INCLUDE command unconditionally executes a procedure or a recent User Language request. (The IF command conditionally executes a procedure.)

When a procedure is included, each command in the procedure is executed. Any statements following a BEGIN or MORE command in the procedure are compiled. When an END statement is encountered in the procedure, Model 204 runs the request that precedes the END.

If the request following a BEGIN or MORE command has no END statement and concludes the procedure, the request is compiled through the last statement in the procedure, but the request is not run. You can continue entering the request at this point and then run the request. However, the statements entered at this time are added to the procedure only if it is temporary procedure 0. If the procedure has a name or a nonzero number, it is not altered. This is shown in the example that follows.

Suppose that temporary procedure -3 continues a User Language request but has no END statement. When the user enters:

INCLUDE -3

Model 204 retrieves temporary procedure -3 and compiles it, but cannot execute it. The user can now continue entering the request. The request remains temporary procedure -3; it does not become temporary procedure 0 (the current procedure). When the user enters END, the request is run. However, the stored temporary procedure -3 is not altered. The new statements are not added to the procedure. The procedure can be changed only by reentering the entire request or by invoking the Editor.

The User Language INCLUDE statement is available for inserting procedures into User Language requests. As dummy strings and $READ functions are encountered in the procedure, responses are retrieved, one by one, from the INCLUDE command line. The Model 204 User Language Manual explains the INCLUDE statement, dummy strings, and the $READ function in detail.

When multiple procedure files have been defined in the CREATE GROUP command, the INCLUDE command searches the files in sequence, starting with the first file and ending with the last file defined. The settings of the PRIVDEF parameter do not affect the search order.