$ErrMsg: Difference between revisions
(Automatically generated page update) |
|||
(15 intermediate revisions by 4 users not shown) | |||
Line 1: | Line 1: | ||
<p>The $ | __NOTOC__ | ||
<p> | |||
The <var>$Errmsg</var> function returns a string containing the prefix and text of the last [[Introduction to User Language#Counting errors|counting error]] message or request cancellation message received by the user. </p> | |||
<p>A null value is returned if no counting error or request cancellation message has been received since:</p> | <p>A null value is returned if no counting error or request cancellation message has been received since:</p> | ||
<ul> | <ul> | ||
<li>The beginning of the user's <var class="product">Model 204</var> session</li> | <li>The beginning of the user's <var class="product">Model 204</var> session</li> | ||
<li>The last call to the $ | <li>The last call to the <var>[[$ErrClr]]</var> function.</li> | ||
<li>Processing a | <li>Processing a <var class="product">SOUL</var> <var>Open</var> statement</li> | ||
</li> | |||
</ul> | </ul> | ||
<p> | |||
==Syntax== | |||
<p>A sample $ | This function takes no arguments. | ||
<p class="code"> | |||
==Usage notes== | |||
<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. </p> | |||
==Example== | |||
<p> | |||
A sample <var>$Errmsg</var> 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 | |||
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 | |||
</p> | </p> | ||
==See also== | |||
<ul> | |||
<li><var>IFGERR</var> <var class="product">[[Media:M204_HLIReference_V75.pdf|IFAM]]</var> function. </li> | |||
<li><var>[[$Fsterr]]</var>, which returns the <b>first</b> counting error message. </li> | |||
<li>The <var>[[ERRMSGL parameter|ERRMSGL]]</var> parameter, which determines the length of errors returned by <var>$Errmsg</var> and <var>$Fsterr</var>. | |||
</ul> | |||
[[Category:SOUL $functions]] | [[Category:SOUL $functions]] |
Latest revision as of 17:44, 8 November 2019
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
Syntax
This function takes no arguments.
Usage notes
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.
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