TABLE OF CONTENTS


::pwtk::finish

SYNOPSIS

proc ::pwtk::finish {datafiles} {

USAGE

   finish datafile1 ?datafile2? ...

ARGUMENTS

PURPOSE

"finish" closes the channels associated with the supplied datafiles that were built with the "write" command. Its function is analogous to the Tcl "close" comand.

If a datafile is not associated with an open channel, nothing is done and no error is returned.

SOURCE

    variable write_fid

    set closed 0
    foreach df $datafiles {
        ifexist write_fid($df) {
            flush $write_fid($df)
            close $write_fid($df)
            unset write_fid($df)
            print "Data were written to datafile:   $df"
            set closed 1
        }
    }
    if { $closed } { puts "" }
}