Next: makecols() Up: MacAnova Help File Previous: macrousage()   Contents

macrowrite()

Usage:
macrowrite(fileName,a,b,... [,name:Name,header:F,comments:charVec,\
  oldstyle:T,stripdols:T]), a, b, ... macros, fileName and Name
  CHARACTER scalars, charVec a CHARACTER vector or scalar



Keywords: macros, files, output
macrowrite(FileName,a, b, ... ) writes macros a, b, ... on the file.
Filename must be a CHARACTER variable or quoted string and a, b,
... must be macros.  a, b, ... are written in the form recognized by
macroread.  The default is to write each with no line count in the
header and with a trailing line of the form %macroname%.

If FileName is variable CONSOLE or a CHARACTER variable whose value is
"CONSOLE", the output is written to the screen rather than to a file.
The value of variable CONSOLE is ignored.

If the macro was previously marked to be expanded out-of-line,
"OUTOFLINE" is added to the header line,

Keyword 'new':
macrowrite(FileName, a, b, ..., new:T) removes all information currently
in the file before writing new information.  Without 'new:T', macros are
written at the end of the file.

Keyword 'comment':
macrowrite(FileName, a, comment:charVec) writes each element of
CHARACTER vector or quoted string charVec, prefixed by ") ", as a
comment line after the header.  If header:F appears, no such comments
are written.

Keyword 'header':
macrowrite(FileName,a,b,...,header:F) writes the macros without any
header lines or any trailing %macroname%.  They will not be readable by
macroread().  Also, keyword 'comments' will be ignored.

Keyword 'oldstyle'
macrowrite(FileName, a, b, ..., oldstyle:T) writes each macro in the old
style format.  A line count will be included in the header line and no
trailing %macroname% line will be written.

Keyword 'stripdols'
macrowrite(FileName, a, b, ..., stripdols:T) strips '$$' off the end of
variable names of the form @name$$ as each macro is written, and adds
'DOLLARS' to the header line.  When the macro is subsequently read from
the file by macroread(), '$$' will be automatically added to all
temporary variable names of the form @name.  As long a macro originally
had no temporary variables that did not end in '$$', reading the macro
restores it exactly.  See topics 'macro_files' and 'variables'.  This
feature was added because it is easier to read and edit macros if the
temporary names don't all end in '$$'.

See also topics getmacros(), 'macros', macro(), macroread(), matwrite(),
matread(), 'macro_files', 'files'.


Gary Oehlert 2003-01-15