Minimum Macros
We have seen that a macro can consist of six sections. But not all macros need six sections. If the macro does not accept arguments, there will be no PARAMETER section. If the macro does not use variables, there will be no section defining local variables. There may be no user input section.
The absolute minimum macro cannot have less than three sections:
• DEFINE
• Body
• END_DEFINE
The macro at the beginning of this chapter is an example of a minimum macro. Here it is again:
DEFINE Quit
{###############################################}
{## This macro stores your current ##}
{## drawing in 'filename', then ends ##}
{## your ME-CAD session. ##}
{###############################################}
STORE ALL DEL_OLD 'filename'
EXIT CONFIRM
END_DEFINE
Note that we write statements on separate lines to make them easier to understand. The computer understands the macro even if you write it as:
DEFINE Quit STORE ALL DEL_OLD 'filename' EXIT CONFIRM END_DEFINE