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

 

MACREAD

Purpose:

Reads an external file of macro definitions.

Syntax:

MACREAD("filename")

"filename"

-

A string. The name of the macro file.

Example:

macread("macroscursor.mac")

 

reads the cursor.mac macro file from the macros subdirectory.

Remarks:

A macro file is a simple ASCII text file you can create with any text editor. The file should contain only one macro definition per line. This macro definition is similar to the form required by #define except that the "#define" string itself is optional. For example:

 

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

#define SQUARE(S) S*S

CONSTANT 12.85

 

are all acceptable macro definitions. If a macro was previously defined, the new definition loaded from the macro file will supersede the old one. The macro file name may be any legal "filename" (e.g., 8 alphanumeric characters followed by an optional 3 character alphanumeric extension under DOS).

 

By default, DADiSP reads a macro file named dadisp.mac when the Worksheet option is first selected. By placing your custom macros in dadisp.mac, you can insure that these macros are always available during your DADiSP session.

 

MACREAD can also be invoked in command form:

 

macread macroscursor.mac

See Also:

ALLMACROS

DSPMACREAD

MACROS

MACWRITE