TABLE OF CONTENTS


::pwtk::dumpVars

PURPOSE

Dump variables defined in the current scope.

REMARK

This routine is typically used only internally by PWTK.

SOURCE

    variable dump_set

    if { $hard_dump eq {} } {
        set dump_set ::pwtk::ifset
    } else {
        set dump_set set
    }
    
    uplevel $level {
        pwtk::ifexist res { unset res }
            
        foreach var [info vars] {
            #if { ! [regexp {^(_scriptFile|PWTK_APPLICATION|pwtk_cmd_|auto_path|auto_index|auto_execs|env|errorCode|errorInfo|tcl_..*|argc|argv|argv0)$} $var] } {}
            if { ! [regexp {^(PWTK_APPLICATION|auto_path|auto_index|auto_execs|env|errorCode|errorInfo|tcl_..*|argc|argv|argv0)$} $var] } {
                if { [array exists $var] } {
                    foreach name [array names $var] {
                        append res "$::pwtk::dump_set ${var}($name) [list [::pwtk::varvalue ${var}($name)]]\n"
                    }
                } else {
                    append res "$::pwtk::dump_set $var [list [::pwtk::varvalue ${var}]]\n"
                }
            }
        }
        set res "# load dumped variables\n\n$res\n"
        return $res
    }
}