<doc>
	<legacy_id>1797</legacy_id>
	<name>global</name>
	<type>command</type>

	<syntax>
		<example>global <i>variableNameList</i></example>
	</syntax>

	<synonyms>
	</synonyms>

	<summary>Declares a <command tag="global">global</command> <glossary tag="variable">variable</glossary>.</summary>

	<examples>
<example>global gUserName</example>
<example>global gThisThing,gThatThing,gTheOtherThing</example>
	</examples>

	<history>
		<introduced version="1.0">Added.</introduced>
		<deprecated version=""></deprecated>
		<removed version=""></removed>
		
		<experimental version=""></experimental>
		<nonexperimental version=""></nonexperimental>
	</history>

	<objects>
	</objects>

	<platforms>
		<mac/>
		<windows/>
		<linux/>
		<ios/>
		<android/>
	</platforms>

	<classes>
		<desktop/>
		<server/>
		<web/>
		<mobile/>
	</classes>

	<security>
	</security>


	<classification>
		<category>Values &amp; Properties</category>
	</classification>

	<references>
		<function tag="globalNames">globalNames Function</function>
		<command tag="local">local Command</command>
	</references>

	<description>Use the <b>global</b> <glossary tag="command">command</glossary> to define a <glossary tag="variable">variable</glossary> that can be used in any <glossary tag="handler">handler</glossary>, and which retains its <function tag="value">value</function> between <glossary tag="handler">handlers</glossary>.<p></p><p><b>Parameters:</b></p><p>The <i>variableNameList</i> is a list of <glossary tag="global">global variables</glossary> separated by commas.</p><p></p><p><b>Comments:</b></p><p>You can place the <b>global</b> command either in a handler, or in a script but outside any handler in the script:</p><p></p><p>* If you declare the global in a handler, the <b>global</b> <glossary tag="declare">declaration</glossary> must appear in each <glossary tag="handler">handler</glossary> in which you use the <command tag="global">global</command>. If you <glossary tag="declare">declare</glossary> a <command tag="global">global</command> in one <glossary tag="handler">handler</glossary>, and try to use it in another without first <glossary tag="declare">declaring</glossary> it in that <glossary tag="handler">handler</glossary>, the second <glossary tag="handler">handler</glossary> treats it as a <glossary tag="local variable">local variable</glossary>, and it does not retain its <function tag="value">value</function> between <glossary tag="handler">handlers</glossary>.</p><p></p><p>The <b>global</b> <glossary tag="command">command</glossary> can appear anywhere in a <glossary tag="handler">handler</glossary>, as long as it's before the first <glossary tag="statement">statement</glossary> in which the <glossary tag="global">global variable</glossary> is used. However, to make them easier to find, all <command tag="global">global</command> <glossary tag="declare">declarations</glossary> are usually placed at the beginning of a <glossary tag="handler">handler</glossary>:</p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p>* If you declare a <b>global</b> <glossary tag="command">command</glossary> in a <property tag="script">script</property>, but outside any <glossary tag="handler">handlers</glossary> in the <property tag="script">script</property>, the <command tag="global">global</command> can be used by any <glossary tag="handler">handler</glossary> that comes after the <command tag="global">global</command> <glossary tag="declare">declaration</glossary> in that <property tag="script">script</property>. You don't need to declare such a <command tag="global">global</command> again in the <glossary tag="handler">handler</glossary> itself.</p><p></p><p>Such <b>global</b> <glossary tag="command">commands</glossary> are usually placed at the beginning of the <property tag="script">script</property>, before any <glossary tag="handler">handlers</glossary>, to make them easy to find:</p></description>
</doc>