<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="zh">
		<id>https://zh-cn.arcowiki.com/index.php?action=history&amp;feed=atom&amp;title=%E5%AE%8F</id>
		<title>宏 - 版本历史</title>
		<link rel="self" type="application/atom+xml" href="https://zh-cn.arcowiki.com/index.php?action=history&amp;feed=atom&amp;title=%E5%AE%8F"/>
		<link rel="alternate" type="text/html" href="https://zh-cn.arcowiki.com/index.php?title=%E5%AE%8F&amp;action=history"/>
		<updated>2026-04-08T07:54:11Z</updated>
		<subtitle>本wiki的该页面的版本历史</subtitle>
		<generator>MediaWiki 1.29.1</generator>

	<entry>
		<id>https://zh-cn.arcowiki.com/index.php?title=%E5%AE%8F&amp;diff=182&amp;oldid=prev</id>
		<title>Slia：创建页面，内容为“'''Macro''' are sub-routines that allow to compact a sequence of instructions in a single command.&lt;br/&gt; The macro command can be in the main program or in an externa…”</title>
		<link rel="alternate" type="text/html" href="https://zh-cn.arcowiki.com/index.php?title=%E5%AE%8F&amp;diff=182&amp;oldid=prev"/>
				<updated>2018-06-11T10:01:56Z</updated>
		
		<summary type="html">&lt;p&gt;创建页面，内容为“&amp;#039;&amp;#039;&amp;#039;Macro&amp;#039;&amp;#039;&amp;#039; are sub-routines that allow to compact a sequence of instructions in a single command.&amp;lt;br/&amp;gt; The macro command can be in the main program or in an externa…”&lt;/p&gt;
&lt;p&gt;&lt;b&gt;新页面&lt;/b&gt;&lt;/p&gt;&lt;div&gt;'''Macro''' are sub-routines that allow to compact a sequence of instructions in a single command.&amp;lt;br/&amp;gt;&lt;br /&gt;
The macro command can be in the main program or in an external file.&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== ==&lt;br /&gt;
If the macro description is inside the [[DMIS]] program, it should be written at the beginning of it but, in any case, prior to the execution of the Macro command itself.&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;span style=&amp;quot;color: green; text-decoration: none;&amp;quot;&amp;gt;$$ Example of a MACRO declaration&amp;lt;/span&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt;M(foro)=MACRO/off_x,off_y,'nome_ci'&amp;lt;/code&amp;gt;&lt;br /&gt;
::::&amp;lt;code&amp;gt;	DECL/LOCAL,DOUBLE,r_foro,z_mis&amp;lt;/code&amp;gt;&lt;br /&gt;
::::&amp;lt;code&amp;gt;	r_foro=ASSIGN/6.25&amp;lt;/code&amp;gt;&lt;br /&gt;
::::&amp;lt;code&amp;gt;	z_mis=ASSIGN/-2.5&amp;lt;/code&amp;gt;&lt;br /&gt;
::::&amp;lt;code&amp;gt;	F(@nome_ci) = FEAT/CIRCLE, INNER, CART, off_x, off_y, z_mis, 0, 0, 1, r_foro*2&amp;lt;/code&amp;gt;&lt;br /&gt;
::::&amp;lt;code&amp;gt;	MEAS/CIRCLE, F(@nome_ci), 4&amp;lt;/code&amp;gt;&lt;br /&gt;
::::&amp;lt;code&amp;gt;	GOTO/off_x, off_y, 7&amp;lt;/code&amp;gt;&lt;br /&gt;
::::&amp;lt;code&amp;gt;	PTMEAS/CART, off_x+r_foro,	off_y,		z_mis,	-1, 0, 0&amp;lt;/code&amp;gt;&lt;br /&gt;
::::&amp;lt;code&amp;gt;	PTMEAS/CART, off_x,		off_y+r_foro,	z_mis,	0, -1, 0&amp;lt;/code&amp;gt;&lt;br /&gt;
::::&amp;lt;code&amp;gt;	PTMEAS/CART, off_x-r_foro,	off_y,		z_mis,	1, 0, 0&amp;lt;/code&amp;gt;&lt;br /&gt;
::::&amp;lt;code&amp;gt;	PTMEAS/CART, off_x,		off_y-r_foro,	z_mis,	0, 1, 0&amp;lt;/code&amp;gt;&lt;br /&gt;
::::&amp;lt;code&amp;gt;	GOTO/off_x, off_y, 7&amp;lt;/code&amp;gt;&lt;br /&gt;
::::&amp;lt;code&amp;gt;	ENDMES&amp;lt;/code&amp;gt;&lt;br /&gt;
::::&amp;lt;code&amp;gt;&amp;lt;span style=&amp;quot;color: green; text-decoration: none;&amp;quot;&amp;gt;$$ End of Macro Declaration&amp;lt;/span&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt;ENDMAC&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::&amp;lt;code&amp;gt;&amp;lt;span style=&amp;quot;color: green; text-decoration: none;&amp;quot;&amp;gt;$$ instructions&amp;lt;/span&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt;&amp;lt;span style=&amp;quot;color: green; text-decoration: none;&amp;quot;&amp;gt;$$ instructions&amp;lt;/span&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;span style=&amp;quot;color: green; text-decoration: none;&amp;quot;&amp;gt;$$ Recall to execute the macro&amp;lt;/span&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt;CALL/M(foro),12.5,12.5,foro1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::&amp;lt;code&amp;gt;&amp;lt;span style=&amp;quot;color: green; text-decoration: none;&amp;quot;&amp;gt;$$ instructions&amp;lt;/span&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt;&amp;lt;span style=&amp;quot;color: green; text-decoration: none;&amp;quot;&amp;gt;$$ instructions&amp;lt;/span&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== ==&lt;br /&gt;
If the macro is located in an external file (for example to make sure that the macro can be shared between more programs), then the macro file shall be inserted in the program using the procedure to  [[Include an External Macro File]] at the beginning of the program using an ‘EXTFIL’ command.&lt;br /&gt;
In this case the macros are recalled from the specified external file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;span style=&amp;quot;color: green; text-decoration: none;&amp;quot;&amp;gt;$$ Use of an external file containing macro declaration&amp;lt;/span&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt;EXTFIL/DMIS,'c:\cim\MACRO.dmi'&amp;lt;br/&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The [[External Macro File|external macro file]] has “.DML” extension, begins with &amp;lt;code&amp;gt;DMISMD/&amp;lt;/code&amp;gt; and ends with &amp;lt;code&amp;gt;ENDFIL/&amp;lt;/code&amp;gt;.&amp;lt;br/&amp;gt;&lt;br /&gt;
Inside of the file, the syntax is the same as a regular [[DMIS]] program.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;span style=&amp;quot;color: green; text-decoration: none;&amp;quot;&amp;gt;$$ Declaration of different Macro in an external file&amp;lt;/span&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;DMISMD/'module_name'&amp;lt;/code&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt;&amp;lt;span style=&amp;quot;color: green; text-decoration: none;&amp;quot;&amp;gt;$$ First Macro declaration&amp;lt;/span&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt;M(macro_1)=MACRO/passedtext&amp;lt;/code&amp;gt;&lt;br /&gt;
::::&amp;lt;code&amp;gt;TEXT/OPER,CONCAT('You passed the following text to the macro: ',passedtext)&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt;ENDMAC&amp;lt;/code&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt;&amp;lt;span style=&amp;quot;color: green; text-decoration: none;&amp;quot;&amp;gt;$$ Second Macro declaration&amp;lt;/span&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt;M(macro_2)=MACRO/num1,num2&amp;lt;/code&amp;gt;&lt;br /&gt;
::::&amp;lt;code&amp;gt;DECL/DOUBLE,sumres&amp;lt;/code&amp;gt;&lt;br /&gt;
::::&amp;lt;code&amp;gt;sumres=ASSIGN/num1+num2&amp;lt;/code&amp;gt;&lt;br /&gt;
::::&amp;lt;code&amp;gt;EXT/OPER,CONCAT('The sum of the 2 numbers is: ',STR(sumres))&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt;ENDMAC&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;ENDFIL&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[it:Macro]]&lt;br /&gt;
[[zh-cn:宏]]&lt;br /&gt;
[[pt:Macro]]&lt;br /&gt;
[[de:Makro]]&lt;br /&gt;
[[es:Macro]]&lt;br /&gt;
[[en:Macro]]&lt;/div&gt;</summary>
		<author><name>Slia</name></author>	</entry>

	</feed>