12-13-2024, 07:20 AM
Macro TempEnvVar help
;Auto-restores an environment variable. Or auto-deletes if did not exist.
;Example
TempEnvVar x.Var("TEST") ;;need just this single line
GetEnvVar("TEST" _s); out F"old: {_s}"
SetEnvVar("TEST" "new value")
GetEnvVar("TEST" _s); out F"new: {_s}"
;The TempEnvVar destructor restores or deletes the variable. It runs when the macro or function ends, even on exception.