User Tools

Site Tools


CIGAL Reference Manual, Chapter 2 (Commands): MACRO

MACRO -- Load a macro program into CIGAL's system macro library

usage: macro macname [flag]

The MACRO command is used to copy a macro program into the system macro file. There are two reasons for doing this: First, the system file provides a way of organizing macros. Collecting many macros in one file avoids the clutter of many small disk files. The advantage here being in distributing and backing up CIGAL and its macros. Second, macros execute faster when they are in the system macro library. This is because the library file is indexed and always open (unless it is explicitly closed by the CLOSE command – see CLOSE(2)) so that disk I/O is significantly quicker. This is particularly noticeable when executing macros that call other macros. You should keep in mind, however, that the MACRO command is completely optional. Macros do not need to be loaded into the system macro file to be used.

MACNAME can be an explicit file path name (eg., \CIGAL\IMP\TESTMAC.IMP) or it can be just the macro name (eg., TESTMAC). In the latter case, MACRO will search through the directories specified by the PATH variable (see PATH](4)) until it finds the full file name. Keep in mind that during a search compiled versions of the macro take precedence over noncompiled versions.

The FLAG argument controls what is to be done if the named macro is already loaded into the system macro file. Its meaning is as follows:

    FLAG = 1    Ask for confirmation before deleting previous version
                (this is the default)
         = 2    Do not replace previous version if found
         = 0    Replace previous version without asking for confirmation.

Look at macros in the system file using SHOW MACRO (see SHOW(2)). Delete macros from the system file using DELETE MACRO (see DELETE(2)).

See Also:
CLOSE(2), DELETE(2), MACROS(1), PATH](4), RUN(2), SHOW(2)

CIGAL Home, CIGAL Manual, Commands List, Manual Help

jvs/cigal/manual/chapter2/macro.txt · Last modified: 2023/02/23 18:43 (external edit)