Navigation:  Macros > Macro Language > Variables > Global Variables >


Previous pageReturn to chapter overviewNext page

Global variables are very useful to keep track of information from one occurrence of a macro token to another, but they also require some precautions in using them.


Since the use of global variable is to let you reuse a previous value of a variable, without initializing it every time, the compiler does not issue any warnings about un-initialized global variables. It is your responsibility to write code (such as the one in the example above) to test wether a global variable is initialized or not.


Since the value of global variables "remember" their previous value, each time a macro is executed, the order in which the macros are executed becomes important. This order follows the order in which textboxes were scanned into Q++, which follows the order in which the textboxes were created in your GridTemplate. This means that you usually must plan for the use of global tokens, when designing your GridTemplate.

Topic 134900 updated on 07-Aug-01.
Topic URL: