Chapter 11 Writing Macro Control Statements

11.1 Purpose of This Chapter

Macros consist of two parts: macro definitions and macro calls. A macro that has been defined can be coded as a macro call in any source statement after that.

When a macro without parameters is called, it becomes a simple text substitution. When a macro with parameters is called, part of the text to be substituted will be modified by the strings specified as the parameters.

This chapter explains how define and call macros. It also describes the directives used for macros.

Common coding rules

The characters that can be used for macro names, dummy parameters, parameters, and identifiers are upper and lower case letters, digits, and underscores (_). The first character must not be a digit.

Symbols used in expressions must have been previously defined.

The following directives cannot be coded within macro blocks.

#include directive

macro definitions

Refer to section 11.2, "Macro Definitions", regarding macro definitions and blocks.

The rept and irp directives and macro calls can be coded within macro blocks. Up to 20 nesting levels are allowed.

A dummy parameter appearing in a string or character constant inside the macro is not expanded.

Document conventions

Symbols used in this chapter have the following meanings.

[ ]

( )

Contents of brackets [ ] may be omitted.

Contents of parentheses ( ) may be repeated.

206 Purpose of This Chapter

Page 218
Image 218
Panasonic MN1030 user manual Purpose of This Chapter, #include directive Macro definitions