HP 3000 Manuals

Invoking Macros [ VIRTUOSO CODE GENERATOR Reference Manual ] MPE/iX 5.0 Documentation


VIRTUOSO CODE GENERATOR Reference Manual

Invoking Macros 

Macros can be invoked anywhere in Virtuoso source.  The syntax for
invoking a macro is as follows:

     #Macroname [keyword=value] ...

Here is an example of a statement to invoke the DataBaseOpen macro
discussed earlier in this chapter:

     #DataBaseOpen image-database="!sample-database"   &
     #                       mode="1"

Notice that all that is necessary to invoke a macro is the "#" followed
by the macro name and the required parameters.  Optional parameters can
also be specified; if omitted, the default value is used.  In the example
above, the parameter image-database is required, while mode is optional.
The parameters can be specified in any order; they need not appear in the
same order as they do in the #macro source.  Note that the parameter's
value must appear in quotes if the parameter is of type STRING. Quotes
are not used if the parameter is of type NUMERIC. Substitution is
allowed; the example above uses "!sample-database" as the value for the
parameter image-database.  That is, the value of the keyword
sample-database is passed in as the value of the keyword image-database.

The Source Macro File containing the macro must be processed by the
generator into a Processed Macro File before the macro can be invoked.
Refer to Chapter 5 for more information on processing and referencing
Processed Macro Files.

When a macro is invoked in Virtuoso source, the indentation of the macro
name in the source code line determines the overall indentation of the
code generated by the macro.  Refer to the section on macro indentation
under "Formatting Modes" in Chapter 2 for examples.



MPE/iX 5.0 Documentation