home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.tcl
- Path: sparky!uunet!cis.ohio-state.edu!zaphod.mps.ohio-state.edu!menudo.uh.edu!sugar!karl
- From: karl@NeoSoft.com (Karl Lehenbauer)
- Subject: Re: Periodic Actions in Tcl/Tk
- Organization: NeoSoft Communications Services -- (713) 684-5900
- Date: Mon, 07 Sep 1992 17:15:34 GMT
- Message-ID: <1992Sep07.171534.19571@NeoSoft.com>
- References: <VEK.92Aug31115650@rover.allegra.att.com>
- Lines: 17
-
- In article <VEK.92Aug31115650@rover.allegra.att.com> vek@allegra.att.com (Van Kelly) writes:
- >What is the best way to define a period action (say, once every n seconds)
- >in a Tcl/TclX/Tk environment, given that there may be a number of these
- >one might wish to set up and later selectively cancel at a later date.
-
- >The first thing I thought of was to have a global variable, say FOO,
- >containing the code for a periodic action followed by an after command
- >to re-evaluate itself. But this is obviously tail-recursive and may
- >explode its stack pretty fast.
-
- It isn't tail-recursive, it is still iterative. The "after" command simply
- schedules some command to execute later, so it is fine for a procedure
- to reschedule itself with "after".
- --
- -- Email info@NeoSoft.com for info on getting interactive Internet access.
- You will now awaken feeling relaxed and refreshed, remembering everything
- you've read except the details of the Omega contingency plan.
-