613-518-1166 info@zimdatabases.com

Developing ZIM Applications

The Availability of Macros

< All Topics

You can declare two different kinds of macros during an application session:

  • global macros

  • local macros

Global Macros

The name declaration for a global macro uses the following syntax:

<name>

where

name

a valid identifying name for the macro

< and >

macro name delimiters make the macro easy to distinguish

After a global macro is declared, you can reuse it in any application program for the duration of the application session. When the session ends, the macro is no longer available.

Local Macros

The name declaration for a global macro uses the following syntax:

<n>

where:

n

a number from 0 to 9

< and >

macro name delimiters make the macro easy to distinguish

Every procedure has its own set of ten local macros, <0> through <9>. You can use a local macro only while the procedure to which it belongs continues to execute. Once execution control transfers elsewhere, the local macros particular to that procedure are discarded.

Examples

Consider a global macro, . If you define to represent the character string list all, then the statement

# Documents

is interpreted as

list all Documents

# is the macro call that is replaced by the character string the represents, list all. The number sign (#) is the macro call indicator.

If you redefine to represent the character string ENT, then the statement

list #s format #Name

is interpreted as

list ENTs format ENTName

Was this article helpful?
0 out Of 5 Stars
5 Stars 0%
4 Stars 0%
3 Stars 0%
2 Stars 0%
1 Stars 0%
How can we improve this article?
Table of Contents