dp_var_value

one of the documented procedures in this installation of the ACS
Usage:
dp_var_value   varname
What it does:
get the value of $varname one way or another: 1) if dp_form exists, it uses those values to fill the form fields. 2) if dp_form is missing, it looks for dp_select, which should be an ns_set from a [ns_db select]
Defined in: /web/philip/tcl/data-pipeline-defs.tcl

Source code:


    upvar dp_form dp_form

    if [info exists dp_form] {
	if {[ns_set find $dp_form $varname] != -1} {
	    return [ns_set get $dp_form $varname]
	} else {
	    # strip off the data type and look for it again in dp_form.
	    set varname_no_data_type [join [lrange [split $varname .] 0 2] "."]
	    return [ns_set get $dp_form $varname_no_data_type]
	}
    } else {
        upvar dp_select dp_select
        if [info exists dp_select] {
            if [empty_string_p $dp_select] {
                return ""
            }
            set colname [lindex [split $varname .] 2]
            return [ns_set get $dp_select $colname]
        } else {
            # give up
	    return
        }
    }


philg@mit.edu