envStoreEnv
envStoreEnv( [?envFilet_fileName] [?toolt_tool[.partition] ] [?toolStatust_toolStatus] [?varStatuss_varStatus] [?fileStatust_fileStatus] ) =>t / nil
Description
Stores environment variables associated with tools to a specific file. You can choose to save variables for a specific tool, all loaded tools, or all possible tools. You can also specify whether you want to save all the variables for a tool, the variables that have been modified, or only the variables that have been modified and that are different from the default value.
This function is the programmatic equivalent of saving variables with the Save Defaults form.
Arguments
Examples
The following example shows different environment variables that need to be saved to the existing file (myDefs) based on the values of t_toolStatus, t_tool[.partition], s_varStatus, and t_fileStatus. Assume that the list of all possible tools includes testTool, anotherTool and tool3.
Master variable registration file located in etc/tools/testTool/.cdsenv:
testTool nestLimit int 5 nil
testTool showScrollBars boolean nil nil
testTool setWinTraversal boolean nil nil
testTool undoLevel int 1 nil
Master variable registration file located in etc/tools/anotherTool/.cdsenv:
anotherTool var1 string "hi" nil
anotherTool var2 int 50 nil
anotherTool var3 cyclic "v2" nil ("v1" "v2" "v3")
Master variable registration file located in etc/tools/tool3/.cdsenv:
tool3.part1 check boolean nil nil
tool3.partb level int 20 nil
tool3 auto boolean t nil
testTool nestLimit int 3
testTool undoLevel int 5
tool3 auto boolean nil
tool3.partb level int 9
anotherTool var3 cyclic "v3"
Environment variable settings in the current session:
testTool nestLimit int 2 (modified and different from default)
testTool showScrollBars boolean nil
testTool setWinTraversal boolean t (modified and different from default)
testTool undoLevel int 1
tool3 auto boolean t (modified and same as default)
The following is a list of environment variables that need to be saved to file myDefs depending on the settings for t_fileStatus, t_tool[.partition], s_varStatus and t_toolStatus.
For ?fileStatus Overwrite, ?toolStatus Loaded tools by name, ?tool testTool tool3, and ?varStatus ’modified:
testTool nestLimit int 2
testTool setWinTraversal boolean t
tool3 auto boolean t
For ?fileStatus Merge values, ?toolStatus Loaded tools by name, ?tool testTool tool3, and ?varStatus ’modified:
testTool nestLimit int 2
testTool setWinTraversal boolean t
testTool undoLevel int 5
tool3 auto boolean t
tool3.partb level int 9
anotherTool var3 cyclic "v3"
For ?fileStatus Retain values, ?toolStatus Loaded tools by name, ?tool testTool tool3, and ?varStatus ’modified:
testTool nestLimit int 3
testTool setWinTraversal boolean t
testTool undoLevel int 5
tool3 auto boolean nil
tool3.partb level int 9
anotherTool var3 cyclic "v3"
For ?fileStatus Merge values, ?toolStatus Loaded tools by name, ?tool testTool tool3, and ?varStatus ’modifiedFromDefault:
testTool nestLimit int 2
testTool setWinTraversal boolean t
For ?fileStatus Overwrite and ?toolStatus All possible tools:
testTool nestLimit int 2
testTool showScrollBars boolean nil
testTool setWinTraversal boolean t
testTool undoLevel int 1
anotherTool var1 string "hi"
anotherTool var2 int 50
anotherTool var3 cyclic "v2"
tool3.part1 check boolean nil
tool3.partb level int 20
tool3 auto boolean t
For ?fileStatus Merge values and ?toolStatus All possible tools:
testTool nestLimit int 2
testTool showScrollBars boolean nil
testTool setWinTraversal boolean t
testTool undoLevel int 5
anotherTool var1 string "hi"
anotherTool var2 int 50
anotherTool var3 cyclic "v2"
tool3.part1 check boolean nil
tool3.partb level int 9
tool3 auto boolean t
For ?fileStatus Retain values and ?toolStatus All possible tools:
testTool nestLimit int 3
testTool showScrollBars boolean nil
testTool setWinTraversal boolean t
testTool undoLevel int 5
anotherTool var1 string "hi"
anotherTool var2 int 50
anotherTool var3 cyclic "v3"
tool3.part1 check boolean nil
tool3.partb level int 9
tool3 auto boolean nil
For ?fileStatus Overwrite, ?toolStatus Loaded tools by name, ?tool tool3, and ?varStatus ’all:
tool3 auto boolean t
tool3.part1 check boolean nil
tool3.partb level int 20
For ?fileStatus Overwrite, ?toolStatus Loaded tools by name, ?tool tool3., and ?varStatus ’all:
tool3 auto boolean t
For ?fileStatus Overwrite, ?toolStatus Loaded tools by name, ?tool tool3.part1, and ?varStatus ’all:
tool3.part1 check boolean nil
Related Topics
Return to top