Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Restoring an environment variable
#1
Macro TempEnvVar help
Code:
Copy      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.


Attached Files
.qml   TempEnvVar.qml (Size: 3 KB / Downloads: 14)
#2
Thank you very much for the sharing.


Forum Jump:


Users browsing this thread: 1 Guest(s)