$ErrMsg: Difference between revisions

From m204wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 11: Line 11:
<p>Refer to the Rocket <var class="product">Model&nbsp;204</var> Messages Manual for more information on counting messages. This function takes no arguments.            </p>
<p>Refer to the Rocket <var class="product">Model&nbsp;204</var> Messages Manual for more information on counting messages. This function takes no arguments.            </p>
<b>Example</b>
<b>Example</b>
<p>A sample $ERRMSG function with an ON ERROR unit follows. To learn about ON ERROR units, see [[Subroutines#ON units|ON units]].</p>
<p>A sample $ERRMSG function with an <var>On Error</var> unit follows. To learn about <var>On Error</var> units, see [[Subroutines#ON units|ON units]].</p>
<p class="code">BEGIN
<p class="code">begin
ERROR.PROC: ON ERROR
error.proc: on error
               PRINT 'THE REQUEST IS ENDING'
               print 'The request is ending'
               PRINT 'THE LAST ERROR MESSAGE RECEIVED WAS:'
               print 'The last error message received was:'
               PRINT $ERRMSG
               print $errMsg
             END ON
             end on
GET.RECSFIND ALL RECORDS FOR WHICH
get.recsfind all records for which
               AGENT = CASOLA
               agent = casola
             END FIND
             end find
             FOR EACH RECORD IN GET.RECS
             for each record in get.recs
               .
               .
               .
               .
               .
               .
             END FOR
             end for
END 
end
</p>
</p>
<p>The maximum length of the returned string is determined by the setting of the [[ERRMSGL parameter]]. That parameter defaults to 80 which means a maximum of 79 characters are returned, but ERRMSGL can be set as high as 256 which means up to 255 characters would be returned.
<p>The maximum length of the returned string is determined by the setting of the <var>[[ERRMSGL parameter|ERRMSGL]]</var> parameter. That parameter defaults to 80 which means a maximum of 79 characters are returned, but <var>ERRMSGL</var> can be set as high as 256 which means up to 255 characters would be returned.
==See also==
==See also==
<ul>
<ul>
<li>the [[IFGERR IFAM function]]
<li>the [[IFGERR IFAM function]]
<li><var>[[$FSTERR]]</var>, which returns the <b>first</b> counting error message.
<li><var>[[$FSTERR]]</var>, which returns the <b>first</b> counting error message.
<li>The [[ERRMSGL parameter]], which determines the length of errors returned by <var>[[$ERRMSG]]</var> and <var>[[$FSTERR]]</var>.
<li>The <var>[[ERRMSGL parameter|ERRMSGL]]</var>, which determines the length of errors returned by <var>[[$ERRMSG]]</var> and <var>[[$FSTERR]]</var>.
</ul>
</ul>
[[Category:SOUL $functions]]
[[Category:SOUL $functions]]

Revision as of 22:33, 26 April 2014

The $ERRMSG function returns a string containing the prefix and text of the last counting error message or request cancellation message received by the user.

A null value is returned if no counting error or request cancellation message has been received since:

  • The beginning of the user's Model 204 session
  • The last call to the $ERRCLR function.
  • Processing a User Language OPEN statement

Refer to the Rocket Model 204 Messages Manual for more information on counting messages. This function takes no arguments.

Example

A sample $ERRMSG function with an On Error unit follows. To learn about On Error units, see ON units.

begin error.proc: on error print 'The request is ending' print 'The last error message received was:' print $errMsg end on get.recs: find all records for which agent = casola end find for each record in get.recs . . . end for end

The maximum length of the returned string is determined by the setting of the ERRMSGL parameter. That parameter defaults to 80 which means a maximum of 79 characters are returned, but ERRMSGL can be set as high as 256 which means up to 255 characters would be returned.

See also