Examples of the use of Global Variables

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

Examples of the use of Global Variables

Previous pageReturn to chapter overviewNext page

Although Global Variables all work the same way technically, in practise, their use differs depending on their data type.

 

Boolean global variables are usually used to keep track of a "state" in which the diary being produced is, at the time the macro is executed.

 

An example might be a bilingual diary where the order of the languages is switched every week to handle each linguistic group's susceptibilities. In that case, bg1 might be true if this is the week where language A is first and false if this is the week where language B is first.

 

Another example is information that must appear only once in a diary, but to coincide with some other information. For example suppose you put Muslim holidays in a diary, but are required to display a copyright notice at the bottom of the first page where one of these holidays occurs. In this case, bg1 would be false until the first holiday had occured and true from then on (indicating that the copyright notice should not be displayed again).

 

String global variables are often used to "grow" a string, accumulating strings from each execution of the macro, into a total string.

 

Integer global variables are often used to keep some kind of a "counter" value between executions of a macro (see example in next section).


Topic 134400 updated on 17-Mar-2001.
Topic URL: http://www.qppstudio.net/webhelp/index.html?examples2.htm