<?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=TRAP</id>
	<title>TRAP - 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=TRAP"/>
	<link rel="alternate" type="text/html" href="https://wiki.ice-online.com/index.php?title=TRAP&amp;action=history"/>
	<updated>2026-08-03T14:47:20Z</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=TRAP&amp;diff=788&amp;oldid=prev</id>
		<title>ConvertBot: Handles trapping of errors in the macro language</title>
		<link rel="alternate" type="text/html" href="https://wiki.ice-online.com/index.php?title=TRAP&amp;diff=788&amp;oldid=prev"/>
		<updated>2020-04-27T22:04:57Z</updated>

		<summary type="html">&lt;p&gt;Handles trapping of errors in the macro language&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Handles trapping of errors in the macro language&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;TYPE&amp;gt;  - Type of exception = ERROR|WARNING|OFF            [DEF=ERROR]&lt;br /&gt;
&amp;lt;LABEL&amp;gt; - Name of statement label or &amp;quot;OFF&amp;quot; to disable TRAP [DEF=OFF]&lt;br /&gt;
&amp;lt;QUIET&amp;gt; - YES to trap quietly; NO to trap noisily          [DEF=NO]&lt;br /&gt;
&lt;br /&gt;
The above parameters are only used for .TXT macro support. NeXtMidas .MM macro&lt;br /&gt;
traps are enabled by defining a processException procedure in your macro.&lt;br /&gt;
&lt;br /&gt;
Traps are ALWAYS ON in NeXtMidas. Handle macro exceptions (errors) by including&lt;br /&gt;
a processException procedure in your macro.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
  startmacro&lt;br /&gt;
&lt;br /&gt;
    set fileName &amp;quot;bad_file_name&amp;quot;&lt;br /&gt;
    label re_enter&lt;br /&gt;
     if filename EQS &amp;quot;bad_file_name&amp;quot; then&lt;br /&gt;
       error &amp;quot;The file name ^filename is a BAD file name&amp;quot;&lt;br /&gt;
     endif&lt;br /&gt;
    stop&lt;br /&gt;
&lt;br /&gt;
    label try_again&lt;br /&gt;
      set newFileName &amp;quot;good_file_name&amp;quot;&lt;br /&gt;
      ask S:filename &amp;quot;^filename is a BAD.  Enter new filename[^newfileName]: &amp;quot;&lt;br /&gt;
    goto re_enter&lt;br /&gt;
&lt;br /&gt;
  endmacro&lt;br /&gt;
&lt;br /&gt;
  procedure processException M:emsg&lt;br /&gt;
    ! say &amp;quot;Caught exception, name=^{emsg.name} emsg.data=^{emsg.data}&amp;quot;&lt;br /&gt;
    say &amp;quot;Caught exception, continue processing..&amp;quot;&lt;br /&gt;
    goto try_again&lt;br /&gt;
  return&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>