$ErrMsg: Difference between revisions

From m204wiki
Jump to navigation Jump to search
m (Mlarocca moved page $ERRMSG to $Errmsg: Lower case change)
No edit summary
Line 4: Line 4:
<li>The beginning of the user's <var class="product">Model&nbsp;204</var> session</li>
<li>The beginning of the user's <var class="product">Model&nbsp;204</var> session</li>
</li>
</li>
<li>The last call to the <var>[[$ERRCLR]]</var> function.</li>
<li>The last call to the <var>[[$ErrClr]]</var> function.</li>
</li>
</li>
<li>Processing a <var class="product">SOUL</var> <var>Open</var> statement</li>                                                   
<li>Processing a <var class="product">SOUL</var> <var>Open</var> statement</li>                                                   
Line 32: Line 32:
<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 <var>[[ErrMsgL parameter|ERRMSGL]]</var> parameter, which determines the length of errors returned by <var>$ErrMsg</var> and <var>$FstErr</var>.
<li>The <var>[[ERRMSGL parameter|ERRMSGL]]</var> parameter, 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 13:59, 1 August 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 SOUL 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

  • the IFGERR IFAM function
  • $Fsterr, which returns the first counting error message.
  • The ERRMSGL parameter, which determines the length of errors returned by $Errmsg and $FstErr.