Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Macro name changed from html to html-bobswift during server to cloud migration processing.

...

The following three scripts demonstrate variable scope:

script1.udm

Panel

Html bobswift

<pre>
set var1="a global variable"
set var2="a global variable"
set var3="a global variable"
print msg="The value of var1 is $(var1)"
print msg="The value of var2 is $(var2)"
print msg="The value of var3 is $(var3)"
call script2.udm var1="passed into script2"
              var2="passed into script2"
</pre>

script2.udm

Panel

Html bobswift

<pre>
print msg="The value of var1 is $(var1)"
print msg="The value of var2 is $(var2)"
print msg="The value of var3 is $(var3)"
call script3.udm var1="passed into script3"
</pre>

script3.udm

Panel

Html bobswift

<pre>
print msg="The value of var1 is $(var1)"
print msg="The value of var2 is $(var2)"
print msg="The value of var3 is $(var3)"
</pre>

Running UDM and calling script1.udm produces the following results:

Panel

Html bobswift

<pre>
Processing script: script1.udm
The value of var1 is a global variable
The value of var2 is a global variable
The value of var3 is a global variable
Processing script: script2.udm
The value of var1 is passed into script2
The value of var2 is passed into script2
The value of var3 is a global variable
Processing script: script3.udm
The value of var1 is passed into script3
The value of var2 is passed into script2
The value of var3 is a global variable
Finished processing script: script3.udm
Finished processing script: script2.udm
Finished processing script: script1.udm
</pre>

Anchor
User-Defined Variables
User-Defined Variables
User-Defined Variables

...