TABLE OF CONTENTS
::pwtk::input::namelistIfsetVar
SYNOPSIS
proc ::pwtk::input::namelistIfsetVar {name varName varValue} {
PURPOSE
Set a namelist's variable only if it does not exists.
ARGUMENTS
- name -- name of namelist
- varName -- name of variable to query
- varValue -- value to set the variable to
RETURN The value of the $varName variable or an empty string if the $name namelist does not exist
SOURCE
global pwtk::input::namelist set result {} if { [info exists pwtk::input::namelist($name) ] } { if { ! [info exists pwtk::input::namelist($name,var=$varName)] } { set result [set pwtk::input::namelist($name,var=$varName) $varValue] } set result $pwtk::input::namelist($name,var=$varName) } return $result }