Changeset 997 for trunk/expgui
- Timestamp:
- Sep 7, 2010 12:58:41 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/expgui
r996 r997 53 53 if {$argv != ""} { 54 54 if {[string match *noshell* [string tolower $argv]]} { 55 # puts noshell55 # I doubt that noshell mode is used by anyone 56 56 set expgui(shell) 0 57 SetEXPfile[lindex $argv 1]57 set expgui(expfile) [lindex $argv 1] 58 58 } else { 59 SetEXPfile [lindex $argv 0] 60 } 61 if {[string match -nocase {.o[0-9a-f][0-9a-f]} \ 62 [file extension $expgui(expfile)]]} { 63 # this is an archived file -- need to handle this later 64 tk_dialog .expFileErrorMsg "No archived files yet" \ 65 "At present you must use open (expnam) to open archived files" warning 0 "Continue" 66 set expgui(expfile) {} 67 } 59 set expgui(expfile) [lindex $argv 0] 60 } 68 61 } 69 62 … … 299 292 } 300 293 #--------------------------------------------------------------------------- 294 if {$expgui(expfile) != ""} { 295 if {[string match -nocase {.o[0-9a-f][0-9a-f]} \ 296 [file extension $expgui(expfile)]]} { 297 if {[file exists $expgui(expfile)]} { 298 # this is an archived file -- archive the current .EXP file 299 set expnam [file rootname $expgui(expfile)] 300 # get the last archived version 301 set lastf [lindex [lsort [glob -nocomplain $expnam.{O\[0-9A-F\]\[0-9A-F\]}]] end] 302 if {$lastf == ""} { 303 set num 01 304 } else { 305 regexp {.*\.O([0-9A-F][0-9A-F])$} $lastf a num 306 scan $num %x num 307 if {$num >= 255} { 308 set num FF 309 } else { 310 set num [string toupper [format %.2x [incr num]]] 311 } 312 } 313 catch { 314 set newfile $expnam.O$num 315 file rename -force $expnam.EXP $newfile 316 set fp [open $expnam.LST a+] 317 puts $fp "\n----------------------------------------------" 318 puts $fp " Regressing to archive file [file tail $expgui(expfile)]" 319 puts $fp " but first archiving [file tail $expnam.EXP] as [file tail $newfile]" 320 puts $fp "----------------------------------------------\n" 321 close $fp 322 } 323 file copy -force $expgui(expfile) $expnam.EXP 324 set expgui(expfile) $expnam.EXP 325 } else { 326 MyMessageBox -parent . -title "File not found" \ 327 -message "Warning -- Archive file $expgui(expfile) was not found." \ 328 -icon warning -type OK -default ok 329 set expgui(expfile) {} 330 } 331 } else { 332 SetEXPfile $expgui(expfile) 333 } 334 } 301 335 if {$expgui(expfile) == ""} { 302 336 # place the parent window because the getExpFileName window will be centered above it.
Note: See TracChangeset
for help on using the changeset viewer.