* Stuart <
bigd...@aol.com>
| I was just wondering if there are any drawbacks to doing something like this:
| proc Repeat {} {
| {
| execute some Tcl/Tk code
| }
| # Repeat after 30minutes have elapsed'
| after 18000000 Repeat
| }
Possibly two problems:
- if Repeat is called twice during the 30 minutes, it will also schedule
*two* reinvocations.
- in case of an error in the Tcl/Tk code the new 'after' invocation is
not triggered, so the repetition stops.
If it is crucial that the repetition never stops, either 'catch' the
Tcl/Tk code, or invoke 'after' as first thing in the proc, probably
together with a global id to prevent multiple reinvocations:
set ::repeat_id {}
proc Repeat {} {
after cancel $::repeat_id
# Repeat after 30minutes have elapsed
set ::repeat_id [after 18000000 Repeat]
# some Tcl/Tk code ...
}
R'