<?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=NXM_Help_MACRO</id>
	<title>NXM Help MACRO - 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=NXM_Help_MACRO"/>
	<link rel="alternate" type="text/html" href="https://wiki.ice-online.com/index.php?title=NXM_Help_MACRO&amp;action=history"/>
	<updated>2026-04-10T10:51:24Z</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=NXM_Help_MACRO&amp;diff=582&amp;oldid=prev</id>
		<title>ConvertBot: Covers the NeXtMidas macro language syntax.</title>
		<link rel="alternate" type="text/html" href="https://wiki.ice-online.com/index.php?title=NXM_Help_MACRO&amp;diff=582&amp;oldid=prev"/>
		<updated>2020-04-27T18:39:27Z</updated>

		<summary type="html">&lt;p&gt;Covers the NeXtMidas macro language syntax.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;lt;div style=&amp;quot;background-color: #eef9ff; border: 1px solid #999; padding: 10px;&amp;quot;&amp;gt;[[NXM_Help|&amp;amp;uarr; ''Go to the full list of NXM Help pages'']].&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;onlyinclude&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
'''Summary:''' Covers the NeXtMidas macro language syntax.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Macros are scripts written in the Midas language.  They are usually interpreted&lt;br /&gt;
languages that may or may not have a translation step.  In X-Midas, macros have&lt;br /&gt;
a text (.txt) and binary (.mcr) form.  In NeXtMidas, only the text (.mm) form&lt;br /&gt;
is used.&lt;br /&gt;
&lt;br /&gt;
=== Translation - the just-in-time translator&amp;lt;span id=&amp;quot;Translation&amp;quot;&amp;gt;&amp;lt;/span&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
 NeXtMidas macros employ a just-in-time translator.  Labels, procedures, and&lt;br /&gt;
 subroutines, are resolved at load time.  Each command line is parsed into&lt;br /&gt;
 an args table and the command object is loaded the first time the command&lt;br /&gt;
 is run.  Subsequent passes through the code have minimal overhead.  Control&lt;br /&gt;
 flow is implemented in the corresponding Intrinsic command using jumps&lt;br /&gt;
 evaluated during translation.&lt;br /&gt;
&lt;br /&gt;
 Unlike X-Midas there are no .TXT or .MCR files.  A NeXtMidas macro has the&lt;br /&gt;
 extension .MM for Midas Macro.  Since it is translated on-the-fly, there&lt;br /&gt;
 are no translated files (.MCR) on disk.  The extension is changed to allow&lt;br /&gt;
 backward support of X-Midas macros.&lt;br /&gt;
&lt;br /&gt;
=== Setup - Graphical setup files&amp;lt;span id=&amp;quot;Setup&amp;quot;&amp;gt;&amp;lt;/span&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
 The graphical (.SET) files of X-Midas are replaced with (.MMP) for Midas&lt;br /&gt;
 Macro Properties.  This file holds graphical as well as non-graphical tuning&lt;br /&gt;
 parameters that are undesirable in the macro text for clarity and re-use&lt;br /&gt;
 reasons.  For example, a macro that can be run locally, remotely, or in a&lt;br /&gt;
 browser may have significantly different graphical setups.  This can be&lt;br /&gt;
 handled in separate .MMP files instead of multiple if-then-else statements&lt;br /&gt;
 within the macro.&lt;br /&gt;
&lt;br /&gt;
=== Structure - the basic structure of a NeXtMidas macro&amp;lt;span id=&amp;quot;Structure&amp;quot;&amp;gt;&amp;lt;/span&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
 The basic structure is shown below:&lt;br /&gt;
&lt;br /&gt;
 startmacro a:arg1[default1] n:arg2[123]&lt;br /&gt;
 local res1 res2 res3&lt;br /&gt;
 global appstate&lt;br /&gt;
 command1 in=arg1 out=_cb1&lt;br /&gt;
 command2 in=_cb1 out=_cb2&lt;br /&gt;
 endmacro&lt;br /&gt;
&lt;br /&gt;
 procedure open&lt;br /&gt;
 return&lt;br /&gt;
&lt;br /&gt;
 procedure process&lt;br /&gt;
 return&lt;br /&gt;
&lt;br /&gt;
 procedure processMessage m:msg&lt;br /&gt;
 return&lt;br /&gt;
&lt;br /&gt;
 procedure processException m:emsg&lt;br /&gt;
 return&lt;br /&gt;
&lt;br /&gt;
 procedure close&lt;br /&gt;
 return&lt;br /&gt;
&lt;br /&gt;
 procedure proc1 s:file=default d:mode&lt;br /&gt;
 return&lt;br /&gt;
&lt;br /&gt;
 procedure proc2&lt;br /&gt;
 return&lt;br /&gt;
&lt;br /&gt;
 subroutine sub1 s:file=default d:mode&lt;br /&gt;
 return&lt;br /&gt;
&lt;br /&gt;
 The first line defines the results names that will contain the parameters&lt;br /&gt;
 supplied at run-time or by the defaults in the command configuration.&lt;br /&gt;
&lt;br /&gt;
 By default, all results created by a macro have local scope only.  They are&lt;br /&gt;
 not accessible by other macros and are automatically destroyed at macro&lt;br /&gt;
 completion.  Global results are always available for read access.  To&lt;br /&gt;
 make a global results writable by a macro, it must be called out using the&lt;br /&gt;
 GLOBAL statement.  The LOCAL command is optional, but can be used with the&lt;br /&gt;
 GLOBAL and IMPLICIT statements to enforce strong type checking.&lt;br /&gt;
&lt;br /&gt;
 The open, process, processMessage, and close procedures apply only to&lt;br /&gt;
 piped macros.&lt;br /&gt;
&lt;br /&gt;
 Control flow and argument parsing overhead for a 3 arg command in a&lt;br /&gt;
 NeXtMidas macro measures approximately 35uSec on a 266MHz laptop.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/onlyinclude&amp;gt;&lt;br /&gt;
[[Category:NXM_Help]]&lt;/div&gt;</summary>
		<author><name>ConvertBot</name></author>
		
	</entry>
</feed>