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

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
}