Macro Language Reference > Macros > System > savevars
  
savevars
Description
Saves the values of variables to a file after PTC ALD has been shut down, so they may be reinstated with a run macro when required. Variables are usually cleared when PTC ALD is shut down.
 
Example 244. Typical uses of savevars
savevars "c:/all_vars.3m","*"
Saves all the variables to a file called all_vars.3m
savevars "myvars.3m","dave_*"
Saves all the variables that begin with "dave_" to a file called myvars.3m
savevars "d:/3d/types.3m","type_?_var"
Saves the variables that begin with "type_?_var" to a file called types.3m in the folder d:/3d/.
savevars "c:/temp/myvars.3m","myvars_*"
Saves all the variables which that begin with "myvars_" in a file named myvars.3m, in the folder c:/temp.
It is often useful to save variables directly to a tag that is actually contained within the document, such as the autoexec tag. You can do this by saving variables to one of PTC ALD internal file areas. Below are three examples of this:
savevars "{0}autoexec.sc"*"pattern"
Overwrite or create a new autoexec tag.
savevars "{1}autoexec" "*"
Inserts variables at the top of autoexec.
savevars "{2}autoexec" "*"
Inserts variables at the end of autoexec.
Syntax
savevars filename:s pattern:s
filename
The full name of the file (including path or file area location) to which to save the variables. For the sake of consistency, this should usually have the extension .3m to denote a macro file.
pattern
A wildcard pattern specifying which variables are to be saved to filename.
Related Links