https://m204wiki.rocketsoftware.com/index.php?title=SETGRC_command&feed=atom&action=historySETGRC command - Revision history2024-03-29T15:16:39ZRevision history for this page on the wikiMediaWiki 1.40.1https://m204wiki.rocketsoftware.com/index.php?title=SETGRC_command&diff=102288&oldid=prevELowell at 16:16, 22 March 20172017-03-22T16:16:12Z<p></p>
<table style="background-color: #fff; color: #202122;" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en">
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Older revision</td>
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 16:16, 22 March 2017</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l59">Line 59:</td>
<td colspan="2" class="diff-lineno">Line 59:</td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div><p>Use SETGRC to test for the success or failure of <var class="product">Model&nbsp;204</var> command execution when you are working in User Language. </p></div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div><p>Use SETGRC to test for the success or failure of <var class="product">Model&nbsp;204</var> command execution when you are working in User Language. </p></div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div><p>If there are no counting errors in the execution of the preceding command, SETGRC sets a global variable to <var>0</var>. If there are counting errors, SETGRC sets a global variable to <var>1</var>. </p></div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div><p>If there are no counting errors in the execution of the preceding command, SETGRC sets a global variable to <var>0</var>. If there are counting errors, SETGRC sets a global variable to <var>1</var>. </p></div></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>[[Category: <del style="font-weight: bold; text-decoration: none;">General user </del>commands]]</div></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>[[Category: <ins style="font-weight: bold; text-decoration: none;">User </ins>commands]]</div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>[[Category:Commands]]</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>[[Category:Commands]]</div></td></tr>
</table>ELowellhttps://m204wiki.rocketsoftware.com/index.php?title=SETGRC_command&diff=53118&oldid=prevAlex: Automatically generated page update2013-02-28T01:05:26Z<p>Automatically generated page update</p>
<p><b>New page</b></p><div>==Summary==<br />
<dl><br />
<dt>Privileges<br />
<dd>Any user<br />
<dt>Function<br />
<dd>Sets a global variable return code according to the presence or absence of counting errors in the execution of the preceding command <br />
</dl><br />
==Syntax==<br />
<p class="syntax">SETGRC [<i>rcname</i>] [<i>errstringname</i>]<br />
</p><br />
<br />
<b>Where:</b><br />
<table> <br />
<tr><br />
<th>rcname</th><br />
<td> is a global variable that holds the return code.</td><br />
</tr><br />
<br />
<tr><br />
<th>errstringname</th><br />
<td> is a global variable that holds the string of the error message associated with the counting error. If multiple messages are issued as a result of the cascade effect of the initial error, the initial error message is retrieved.</td><br />
</tr><br />
<br />
</table><br />
==Example==<br />
In the following example, SETGRC is followed by IF commands that test the success or failure of SETGRC and include different procedures depending on the value of the SETGTRC return code variable: <br />
<p class="code">COPY PROC ALL TO FILEA<br />
SETGRC XRC XMSG<br />
IF XRC = 0, YES.PROC<br />
IF XRC = 1, NO.PROC<br />
</p><br />
<p>If the value of XRC is 1, the procedure NO.PROC, which does error processing and other recovery work, is included: </p><br />
<p class="code">PROC NO.PROC<br />
BEGIN<br />
PRINT 'COPY PROC FAILED - ' WITH $GETG('XMSG')<br />
. . . error processing work . . .<br />
END<br />
END PROCEDURE<br />
</p><br />
<p>If the value of XRC is 0, the procedure YES.PROC is included:</p><br />
<p class="code">PROC YES.PROC<br />
BEGIN<br />
PRINT 'PROCEDURES COPIED SUCCESSFULLY'<br />
. . . continue doing next logical work . . .<br />
END<br />
END PROCEDURE<br />
</p><br />
<p>Similarly, you can follow SETGRC with a request that executes different User Language statements depending on the value in the global variable: </p><br />
<p class="code">COPY PROC ALL TO FILEA<br />
SETGRC YRC YMSG<br />
BEGIN<br />
IF $GETG('YRC') THEN<br />
PRINT 'COPY PROC FAILED - ' WITH $GETG('YMSG')<br />
. . . other error processing statements . . .<br />
ELSE PRINT 'COPY PROC RAN SUCCESSFULLY - PROCESSING CONTINUED'<br />
END IF<br />
</p><br />
==Usage notes==<br />
<p>Use SETGRC to test for the success or failure of <var class="product">Model&nbsp;204</var> command execution when you are working in User Language. </p><br />
<p>If there are no counting errors in the execution of the preceding command, SETGRC sets a global variable to <var>0</var>. If there are counting errors, SETGRC sets a global variable to <var>1</var>. </p><br />
[[Category: General user commands]]<br />
[[Category:Commands]]</div>Alex