DADiSP Worksheet Functions > Function Categories > Macro and Command File Functions > MACWRITE

 

MACWRITE

Purpose:

Writes the current macro list to an external file.

Syntax:

MACWRITE("filename", start, end, all, overwrite)

 

"filename"

-

A string. The name of the target macro file.

start

-

Optional. An integer, the starting macro to begin writing from. Defaults to 1, the first macro.

end

-

Optional. An integer, the ending macro to write. Defaults to -1, all macros.

all

-

Optional. An integer, the type of macros to write.

0:

Write visible macros (default)

1:

Write visible and hidden macros

2:

Write hidden macros only

overwrite

-

Optional. An integer, the overwrite flag.

0:

Prompt if file exists (default)

1:

Overwrite existing file

Example:

macwrite("THREE.MAC")

 

would write the following lines to the file named THREE.MAC:

 

NORMALIZE(S) (S-MIN(S))/(MAX(S)-MIN(S))

SQUARE(S) S*S

CONSTANT 12.85

 

if these were the only macros currently defined. To write a subset of the macro list, use the start and end parameters:

 

macwrite("MYMAC", 4, 15)

 

writes macros 4 through 15 to the file named MYMAC.

Example:

macwrite("ALLMACS", 1, -1, 1)

 

writes all macros including those which begin with an underscore(_) to the file named ALLMACS.

Remarks:

MACWRITE writes the current macro list (one macro per line as displayed by the MACROS command) to the specified file as ASCII text.

 

The macro file name may be any legal "filename" (e.g., 8 alphanumeric characters followed by an optional 3 character alphanumeric extension under DOS).

 

The MACROS command displays the macro number in the status area.

See Also:

#DEFINE

MACROS

MACREAD