diff options
author | William Joye <wjoye@cfa.harvard.edu> | 2018-06-06 19:02:28 (GMT) |
---|---|---|
committer | William Joye <wjoye@cfa.harvard.edu> | 2018-06-06 19:02:28 (GMT) |
commit | 5178f98a0a216d2419e6695758101ab321495cbf (patch) | |
tree | 174782b591efa61f9ed220c9b84856bcb0e8a379 /ds9/library/util.tcl | |
parent | b3e4ff140fcd7ac46dcdf00049105cfb780294ca (diff) | |
download | blt-5178f98a0a216d2419e6695758101ab321495cbf.zip blt-5178f98a0a216d2419e6695758101ab321495cbf.tar.gz blt-5178f98a0a216d2419e6695758101ab321495cbf.tar.bz2 |
update ds9 parsers
Diffstat (limited to 'ds9/library/util.tcl')
-rw-r--r-- | ds9/library/util.tcl | 40 |
1 files changed, 38 insertions, 2 deletions
diff --git a/ds9/library/util.tcl b/ds9/library/util.tcl index 3bf1339..09cbe48 100644 --- a/ds9/library/util.tcl +++ b/ds9/library/util.tcl @@ -217,11 +217,47 @@ proc ProcessCmdAppend {varname key value {cmd {}}} { } } -proc ProcessCmdCVAR {which value {cmd {}}} { +proc ProcessCmdCVAR {key value {cmd {}}} { global cvarname upvar #0 $cvarname cvar - set cvar($which) $value + set cvar($key) $value + if {$cmd != {}} { + eval $cmd $cvarname + } +} + +proc ProcessCmdCVAR2 {key value key2 value2 {cmd {}}} { + global cvarname + upvar #0 $cvarname cvar + + set cvar($key) $value + set cvar($key2) $value2 + if {$cmd != {}} { + eval $cmd $cvarname + } +} + +proc ProcessCmdCVAR3 {key value key2 value2 key3 value3 {cmd {}}} { + global cvarname + upvar #0 $cvarname cvar + + set cvar($key) $value + set cvar($key2) $value2 + set cvar($key3) $value3 + if {$cmd != {}} { + eval $cmd $cvarname + } +} + +proc ProcessCmdCVAR4 {key value key2 value2 key3 value3 key4 value4 {cmd {}}} { + global cvarname + upvar #0 $cvarname cvar + + set cvar($key) $value + set cvar($key2) $value2 + set cvar($key3) $value3 + set cvar($key4) $value4 if {$cmd != {}} { eval $cmd $cvarname } |