diff options
Diffstat (limited to 'globals.tcl')
-rw-r--r-- | globals.tcl | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/globals.tcl b/globals.tcl index 275a6a301..b8997102c 100644 --- a/globals.tcl +++ b/globals.tcl @@ -437,3 +437,22 @@ proc SqlQuote {str} { return $str } + + +proc Param {value} { + global param + if {[info exists param($value)]} { + return $param($value) + } + # Um, maybe we haven't sourced in the params at all yet. + catch {uplevel \#0 source "params"} + if {[info exists param($value)]} { + return $param($value) + } + # Well, that didn't help. Maybe it's a new param, and the user + # hasn't defined anything for it. Try and load a default value + # for it. + uplevel #0 source "defparams.tcl" + WriteParams + return $param($value) +} |