Initializing Global Variables

Navigation:  Appendices > Macro Language > Variables > Global Variables >

Initializing Global Variables

Previous pageReturn to chapter overviewNext page

Since global variables keep their value from one execution of the macro to another, it is important to be able to decide in your code if a given global variable has been used before (in which case you do not modify its value at the start of the macro), or if it is the first time (in which case you must initialize it just like any other variable). To see this you call the IsInitialized() function.

 

global

 nGlob

var

begin

 // check if ng_1 was initialized before

 if IsInitialized(nGlob)

         nGlob = nGlob + 1 // increase it

 else

         nGlob = 1 // initialize it

 endif

 // ...

end


Topic 134700 updated on 01-Oct-2001.
Topic URL: http://www.qppstudio.net/webhelp/index.html?initializing.htm