INCLUDE command: Difference between revisions

From m204wiki
Jump to navigation Jump to search
No edit summary
m (add links)
 
Line 6: Line 6:
<dd>Executes a procedure
<dd>Executes a procedure
</dl>
</dl>
==Syntax==
==Syntax==
<p class="syntax"><b>I</b>NCLUDE [<i>procnumber</i> | <i>procname</i>]  
<p class="syntax"><b>I</b>NCLUDE [<span class="term">procnumber</span> | <span class="term">procname</span>]  
   [<i>delimiter response</i> [<i>delimiter response</i>]...]
   [<span class="term">delimiter response</span> [<span class="term">delimiter response</span>]...]
</p>
</p>
   
   
<b>Where:</b>
Where:
<table>  
<table>  
<tr>
<tr>
<th>procnumber</th>
<th>procnumber</th>
<td> is the number of an existing temporary procedure; it can be zero or a negative number.</td>
<td>The number of an existing temporary procedure; it can be zero or a negative number.</td>
</tr>
</tr>
   
   
<tr>
<tr>
<th>procname</th>
<th>procname</th>
<td> is the name of an existing procedure.</td>
<td>The name of an existing procedure.</td>
</tr>
</tr>
   
   
<tr>
<tr>
<th>delimiter</th>
<th>delimiter</th>
<td> is one of the following characters:
<td>One of the following characters:
<table>
<table>
<tr class="head"> <th>Character name </th> <th>Keyboard display</th> </tr>
    
    
<tr> <th>Character name </th> <th>Keyboard display</th> </tr>
<tr> <th><var>Blank</var></th>  
 
<td></td> </tr>
<tr> <th><var>Blank</var></th> <td></td> </tr>
   
   
<tr> <th><var>Comma</var></th> <td>( , )</td> </tr>
<tr> <th><var>Comma</var></th>  
<td>( , )</td> </tr>
   
   
<tr> <th><var>Equal sign</var></th> <td>( = )</td> </tr>
<tr> <th><var>Equal sign</var></th>  
<td>( = )</td> </tr>
   
   
<tr> <th><var>Left parenthesis </var></th> <td>( ( )</td> </tr>
<tr> <th><var>Left parenthesis </var></th>  
<td>( ( )</td> </tr>
   
   
<tr> <th><var>Right parenthesis</var></th> <td>( ) )</td> </tr>
<tr> <th><var>Right parenthesis</var></th>  
 
<td>( ) )</td> </tr>
</table>
</table>
</td>
</td></tr>
</tr>
   
   
<tr>
<tr>
<th>response</th>
<th>response</th>
<td> 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.</td>
<td>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.</td>
</tr>
</tr>
</table>
</table>
==Example==
==Example==
<p class="code">INCLUDE
<p class="code">INCLUDE
INCLUDE ACCOUNT, OK, NA, DK
INCLUDE ACCOUNT, OK, NA, DK
</p>
</p>
==Usage notes==
==Usage notes==
<p>The INCLUDE command unconditionally executes a procedure or a recent User Language request. (The IF command conditionally executes a procedure.)</p>
<ul>
<p>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, <var class="product">Model&nbsp;204</var> runs the request that precedes the END.</p>
<li>The <var>INCLUDE</var> command unconditionally executes a procedure or a recent SOUL request. (The <var>IF</var> command conditionally executes a procedure.)</li>
<p>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.</p>
 
<p>Suppose that temporary procedure -3 continues a User Language request but has no END statement. When the user enters: </p>
<li>When a procedure is included, each command in the procedure is executed. If any statements follow a <var>BEGIN</var> or <var>MORE</var> command in the procedure, they are compiled. When an <var>End</var> statement is encountered in the procedure, <var class="product">Model&nbsp;204</var> runs the request that precedes the <var>End</var>.
<p>
If the request that follows a <var>BEGIN</var> or <var>MORE</var> command has no <var>End</var> 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.</p>
<p>
Suppose that temporary procedure -3 continues a SOUL request, but it has no <var>End</var> statement. When the user enters: </p>
<p class="code">INCLUDE -3
<p class="code">INCLUDE -3
</p>
</p>
<p><var class="product">Model&nbsp;204</var> 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.</p>
<p>
<p>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 <i><var class="product">Model&nbsp;204</var> User Language Manual</i> explains the INCLUDE statement, dummy strings, and the $READ function in detail.       </p>
<var class="product">Model&nbsp;204</var> 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 <var>End</var>, 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.</p></li>
<p>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.         </p>
 
<li>The SOUL [[Procedures#INCLUDE statement|INCLUDE statement]] is available for inserting procedures into SOUL requests. As [[Procedures#Dummy strings in procedures|dummy strings and $READ functions]] are encountered in the procedure, responses are retrieved, one by one, from the <var>INCLUDE</var> command line. </li>
 
<li>When multiple procedure files are defined in a <var>CREATE GROUP</var> command, the <var>INCLUDE</var> command searches the files in sequence, starting with the first file and ending with the last file defined. The settings of the <var>PRIVDEF</var> parameter do not affect the search order. </li>
</ul>
 
[[Category: User commands]]
[[Category: User commands]]
[[Category:Commands]]
[[Category:Commands]]

Latest revision as of 22:17, 2 January 2018

Summary

Privileges
Any user
Function
Executes a procedure

Syntax

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

Where:

procnumber The number of an existing temporary procedure; it can be zero or a negative number.
procname The name of an existing procedure.
delimiter One of the following characters:
Character name Keyboard display
Blank
Comma ( , )
Equal sign ( = )
Left parenthesis ( ( )
Right parenthesis ( ) )
response 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 SOUL request. (The IF command conditionally executes a procedure.)
  • When a procedure is included, each command in the procedure is executed. If any statements follow a BEGIN or MORE command in the procedure, they are compiled. When an End statement is encountered in the procedure, Model 204 runs the request that precedes the End.

    If the request that follows 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 SOUL request, but it 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 SOUL INCLUDE statement is available for inserting procedures into SOUL requests. As dummy strings and $READ functions are encountered in the procedure, responses are retrieved, one by one, from the INCLUDE command line.
  • When multiple procedure files are defined in a 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.