TABLE OF CONTENTS


::pwtk::test

SYNOPSIS

proc ::pwtk::xxxrun_ {xxx prog args} {

PURPOSE

Used internally by PWTK's ::pwtk::prerun or ::pwtk::postrun.

ARGUMENTS

SOURCE

    variable state
    
    lassign $args arg1 arg2
    set prog [file tail $prog]
    
    if { [llength $args] == 0 } {
        # query mode
        return [varvalue state($xxx,$prog)]
        
    } elseif { [llength $args] == 1 } {
        # set or clear mode
        if { $arg1 eq "clear" || $arg1 eq {} } {
            set state($xxx,$prog) {}
        } else {        
            set state($xxx,$prog) $arg1
        }
    } elseif { [llength $args] == 2 && $arg1 eq "append" } {
        # append mode
        append state($xxx,$prog) \n$arg2
    } else {
        ::pwtk::error "wrong # of arguments, must be one of:\n
$xxx $prog           
$xxx $prog { SCRIPT }
$xxx $prog {}        
$xxx $prog clear     
$xxx $prog append { SCRIPT }\n
but got:
$xxx $prog $args" 1
    }
    return [varvalue state($xxx,$prog)]
}