SDF 2.000: SDF Reference: insert Macro

Contents | Parent Topic | Previous Topic | Next Topic
Home | Catalog

# 6.27. insert Macro

## Interface

The general syntax is:

      !insert macro [; missing]

The arguments are:

Name | Type | Default | Rule
macro | string |  |
missing | string | ok | <ok|error|warning>

See Understanding Macro Interfaces, if necessary.

## Description

The insert macro is used to insert the output of macro into an SDF document. missing determines the action if the macro isn't found:

- ok - do nothing
- warning - report a warning
- error - report an error.

Note: In early versions of SDF, this macro was used to call user-defined macros. In SDF 2.000 or later, user-defined macros can be called using the same syntax as built-in macros.

## Examples

    # Insert the text of macro XXX if it's defined
    !insert 'XXX'

    # Insert the text of macro XXX; output an error if it's not defined
    !insert 'XXX'; 'error'

    # Same as the previous example
    !XXX

Contents | Parent Topic | Previous Topic | Next Topic
Home | Catalog