TABLE OF CONTENTS


::pwtk::load_from

SYNOPSIS

proc ::pwtk::load_from {program inputFile {clear_existing 1}} {

USAGE

   load_from PROGRAM inputFile ?clear_existing?

PURPOSE

Load the input data for PROGRAM from the existing input file.

If clear_existing == 1, then the current input will be cleared, otherwise the data will be simply added to the existing data.

ARGUMENTS

EXAMPLE

   load_from pw.x scf.in

SOURCE

    variable prog2inNN
    variable plugin
    
    if { ! [info exists prog2inNN($program)] && [lsearch -exact $plugin(list) [string tolower $program]] < 0} {
        ::pwtk::error "cannot load the $program input file because $program is neither a supported executable nor plugin" 1
    } 

    if { [info exists prog2inNN($program)] } {
        # executable
        set ns [namespace tail $prog2inNN($program)]
        namespace eval ::pwtk::${ns} load_from[string toupper $ns] $inputFile $clear_existing
    } else {
        # plugin
        set program [string tolower $program]
        namespace eval ::pwtk::${program} load_$program.in $inputFile $clear_existing
    }
}