Ignore:
Timestamp:
Feb 26, 2011 9:47:37 PM (10 years ago)
Author:
toby
Message:

scan .EXP files for GENLES blowups; update web pages

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/sandbox/readexp.tcl

    r1109 r1115  
    99# returns 1 if the file is 80 char/line + cr/lf
    1010# returns 2 if the file is sequential but not fixed-record length
    11 proc expload {expfile} {
    12     global exparray tcl_platform
    13     # $expfile is the path to the data file.
    14 
     11proc expload {expfile "ns {}"} {
     12    # expfile is the path to the data file.
     13    # ns is the namespace to place the output array (default is global)
     14    if {$ns != ""} {
     15        namespace eval $ns {}
     16    }
    1517    if [catch {set fil [open "$expfile" r]}] {
    1618        tk_dialog .expFileErrorMsg "File Open Error" \
     
    2729    }
    2830    catch {
    29         unset exparray
     31        unset ${ns}::exparray
    3032    }
    3133    if {$len > 160} {
     
    3941            incr i2 80
    4042            set key [string range $nline 0 11]
    41             set exparray($key) [string range $nline 12 end]
     43            set ${ns}::exparray($key) [string range $nline 12 end]
    4244        }
    4345    } else {
     
    4547        while {$len > 0} {
    4648            set key [string range $line 0 11]
    47             set exparray($key) [string range $line 12 79]
     49            set ${ns}::exparray($key) [string range $line 12 79]
    4850            if {$len != 81 || [string range $line end end] != "\r"} {set fmt 2}
    4951            set len [gets $fil line]
Note: See TracChangeset for help on using the changeset viewer.