Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
|
|
@ -0,0 +1 @@
|
|||
after 1000 {myroutine x}
|
||||
|
|
@ -0,0 +1 @@
|
|||
after cancel myroutine
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
package require Tk
|
||||
proc update {} {
|
||||
.clockface configure -text [clock format [clock seconds]]
|
||||
after 1000 update ; # call yourself in a second
|
||||
}
|
||||
# now just create the 'clockface' and call ;update' once:
|
||||
pack [label .clockface]
|
||||
update
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
if {[catch { ''... code that might give error ...'' } result]} {
|
||||
puts "Error was $result"
|
||||
} else {
|
||||
''... process $result ...''
|
||||
}
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
try {
|
||||
# Just a silly example...
|
||||
set f [open $filename]
|
||||
expr 1/0
|
||||
string length [read $f]
|
||||
} trap {ARITH DIVZERO} {} {
|
||||
puts "divided by zero"
|
||||
} finally {
|
||||
close $f
|
||||
}
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
proc forfilelines {linevar filename code} {
|
||||
upvar $linevar line ; # connect local variable line to caller's variable
|
||||
set filechan [open $filename]
|
||||
while {[gets $filechan line] != -1} {
|
||||
uplevel 1 $code ; # Run supplied code in caller's scope
|
||||
}
|
||||
close $filechan
|
||||
}
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
forfilelines myline mydata.txt {
|
||||
puts [string length $myline]
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue