<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.ice-online.com/index.php?action=history&amp;feed=atom&amp;title=ERROR</id>
	<title>ERROR - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.ice-online.com/index.php?action=history&amp;feed=atom&amp;title=ERROR"/>
	<link rel="alternate" type="text/html" href="https://wiki.ice-online.com/index.php?title=ERROR&amp;action=history"/>
	<updated>2026-04-09T17:27:35Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.34.1</generator>
	<entry>
		<id>https://wiki.ice-online.com/index.php?title=ERROR&amp;diff=734&amp;oldid=prev</id>
		<title>ConvertBot: causes a macro to terminate with an error</title>
		<link rel="alternate" type="text/html" href="https://wiki.ice-online.com/index.php?title=ERROR&amp;diff=734&amp;oldid=prev"/>
		<updated>2020-04-27T22:04:41Z</updated>

		<summary type="html">&lt;p&gt;causes a macro to terminate with an error&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;causes a macro to terminate with an error&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;text&amp;gt; - message to print to screen when the error occurs&lt;br /&gt;
&lt;br /&gt;
The ERROR command is the macro equivalent of the M.error() function that &lt;br /&gt;
a primitive would use.  Its primary function is to signal an error to the &lt;br /&gt;
calling macro. The command simply throws a MidasException with the given&lt;br /&gt;
message.  If the macro has PROCESSEXCEPTION procedure, it can handle the&lt;br /&gt;
exceptions on a case by case basis.  If not, a message is generated, and&lt;br /&gt;
the macro continues to execute.&lt;br /&gt;
&lt;br /&gt;
Examples:&lt;br /&gt;
  This example shows how a calling macro can use the TRAP command to trap an&lt;br /&gt;
  error generated by ERROR.  In this case, MYMACRO wants to call FIXIT if the&lt;br /&gt;
  macro DANGEROUS has an error: &lt;br /&gt;
&lt;br /&gt;
    -- MYMACRO.M --&lt;br /&gt;
    mymacro a:file&lt;br /&gt;
      TRAP error handler&lt;br /&gt;
      say &amp;quot;Going to call %DANGEROUS.&amp;quot;&lt;br /&gt;
      %dangerous file&lt;br /&gt;
      TRAP error off&lt;br /&gt;
      say &amp;quot;%DANGEROUS executed OK.&amp;quot;&lt;br /&gt;
      STOP&lt;br /&gt;
    endmacro&lt;br /&gt;
&lt;br /&gt;
    procedure handler m:msg&lt;br /&gt;
      say &amp;quot;%DANGEROUS had the problem ^msg.data&amp;quot;&lt;br /&gt;
    return&lt;br /&gt;
&lt;br /&gt;
    procedure processException m:msg&lt;br /&gt;
      say &amp;quot;The file had better have some data elements in it.&amp;quot;&lt;br /&gt;
    return&lt;br /&gt;
    -- END MYMACRO.M --&lt;br /&gt;
&lt;br /&gt;
Switches:&lt;br /&gt;
  None&lt;br /&gt;
&lt;br /&gt;
See Also:  PAUSE, TRAP&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:NXM_Explain]]&lt;/div&gt;</summary>
		<author><name>ConvertBot</name></author>
		
	</entry>
</feed>