<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="pt">
		<id>https://pt.arcowiki.com/index.php?action=history&amp;feed=atom&amp;title=Vari%C3%A1vel_global_e_local_na_macro</id>
		<title>Variável global e local na macro - Histórico de revisão</title>
		<link rel="self" type="application/atom+xml" href="https://pt.arcowiki.com/index.php?action=history&amp;feed=atom&amp;title=Vari%C3%A1vel_global_e_local_na_macro"/>
		<link rel="alternate" type="text/html" href="https://pt.arcowiki.com/index.php?title=Vari%C3%A1vel_global_e_local_na_macro&amp;action=history"/>
		<updated>2026-04-11T03:12:32Z</updated>
		<subtitle>Histórico de edições para esta página nesta wiki</subtitle>
		<generator>MediaWiki 1.29.1</generator>

	<entry>
		<id>https://pt.arcowiki.com/index.php?title=Vari%C3%A1vel_global_e_local_na_macro&amp;diff=117&amp;oldid=prev</id>
		<title>Slia: Criou a página com &quot;The Declaration of A VariableVariables declaration in a Macro can be GLOBAL or LOCAL.  == Global Declaration == The &lt;code&gt;GLOBAL&lt;/code&gt; modifier in the variabl...&quot;</title>
		<link rel="alternate" type="text/html" href="https://pt.arcowiki.com/index.php?title=Vari%C3%A1vel_global_e_local_na_macro&amp;diff=117&amp;oldid=prev"/>
				<updated>2018-06-07T08:07:24Z</updated>
		
		<summary type="html">&lt;p&gt;Criou a página com &amp;quot;The Declaration of A &lt;a href=&quot;/index.php?title=Variable&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;Variable (página não existe)&quot;&gt;Variable&lt;/a&gt;&lt;a href=&quot;/index.php?title=Variables_declaration&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;Variables declaration (página não existe)&quot;&gt;Variables declaration&lt;/a&gt; in a &lt;a href=&quot;/index.php/Macro&quot; title=&quot;Macro&quot;&gt;Macro&lt;/a&gt; can be GLOBAL or LOCAL.  == Global Declaration == The &amp;lt;code&amp;gt;GLOBAL&amp;lt;/code&amp;gt; modifier in the variabl...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Página nova&lt;/b&gt;&lt;/p&gt;&lt;div&gt;The Declaration of A [[Variable]][[Variables declaration]] in a [[Macro]] can be GLOBAL or LOCAL.&lt;br /&gt;
&lt;br /&gt;
== Global Declaration ==&lt;br /&gt;
The &amp;lt;code&amp;gt;GLOBAL&amp;lt;/code&amp;gt; modifier in the [[variable]] declaration makes the [[variable]] created in the [[macro]] '''accessible''' to the main Program.&amp;lt;br /&amp;gt;&lt;br /&gt;
This is used when the result of a [[macro]] shall be used in the main program.&amp;lt;br /&amp;gt;&lt;br /&gt;
The Following example will show that the result of the [[macro]] will be in the DB Viewer even if the [[variable]] has not been declared explicitly in ARCO.&lt;br /&gt;
&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 with GLOBAL Result&amp;lt;/span&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;M(SUM_TWO_NUMBERS)=MACRO/NUMBER1,NUMBER2&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt;DECL/GLOBAL,DOUBLE, RESULT&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt;RESULT=ASSIGN/NUMBER1+NUMBER2&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;CALL/M(SUM_TWO_NUMBERS),100,200&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Local Declaration ==&lt;br /&gt;
The &amp;lt;code&amp;gt;LOCAL&amp;lt;/code&amp;gt; modifier in the [[variable]] declaration makes the [[variable]] created in the [[macro]] '''NOT accessible''' to the main Program.&lt;br /&gt;
This is useful when a support [[variable]] shall be used in the [[macro]] but it is not interesting for the main program.&amp;lt;br /&amp;gt;&lt;br /&gt;
The Following example will show that the result of the [[macro]] will be in the DB Viewer '''but not the temporary [[variable]]'''.&lt;br /&gt;
&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 with GLOBAL Result and Temporary Variable Locally declared&amp;lt;/span&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;M(AVERAGE_3_NUMBER)=MACRO/NUMBER1,NUMBER2,NUMBER3&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt;DECL/LOCAL,DOUBLE, SUM&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt;DECL/GLOBAL,DOUBLE, RESULT&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt;SUM=ASSIGN/NUMBER1+NUMBER2+NUMBER3&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt;RESULT=ASSIGN/SUM/3&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;CALL/M(SUM_TWO_NUMBERS),100,200&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[it:Variabile globale e locale nella macro]]&lt;br /&gt;
[[zh-cn:宏中的全局和局部变量]]&lt;br /&gt;
[[pt:Variável global e local na macro]]&lt;br /&gt;
[[de:Globale und lokale Variable im Makro]]&lt;br /&gt;
[[es:Variable global y local en macro]]&lt;br /&gt;
[[en:Global And Local Variable In Macro]]&lt;/div&gt;</summary>
		<author><name>Slia</name></author>	</entry>

	</feed>