Because of potential conflicts with the global worksheet, the commands SAVE and RETRIEVE do not work in a local macro. Global worksheet variables that have been passed into the macro as arguments assume any new values given to them during the course of the macro execution. You can always save those variables after the macro executes. But you may also want to save local worksheet variables that are not passed as arguments.
To save local worksheet variables, use the WRITE command within your macro.
WRITE E...E |
Writes data in the specified columns or constants to the screen or to a data file |
FILE "filename" |
Specifies to write to a data file |
WRITE stores the designated columns or constants in a text file with the file name you specify and the default file extension DAT.
Suppose you have three column variables in the local worksheet named X, Y, and Z. The command
WRITE X Y Z;
FILE "MYWORK".
saves those three columns in a text file named MYWORK.DAT.
More |
For complete information on WRITE and its subcommands, see WRITE in Session Command Help. |