[REBOL] Re: Newbie question for today
From: g::santilli::tiscalinet::it at: 7-Oct-2003 9:57
Hi Kai,
On Tuesday, October 7, 2003, 1:58:02 AM, you wrote:
KP> I am trying to write an app that monitors a given set of directories on the
KP> local drive at 5 min. intervals and then transfers any file it may find in
KP> one of these dirs to a ftp server, so it needs to basically loop forever.
KP> I want to have a Start/Stop toggle to initate or cancel this operation.
KP> How do I test for a 'cancel event' in my forever loop. Does someone have a
KP> little sample snippet that demonstrates Rebol's abilities for this purpose?
view/new layout [
Button "Stop" [done: yes unview/all]
]
done: no
check-my-dir: does [print "Checking..."]
until [
check-my-dir
wait 5 ; just 5 seconds to test it
done
]
(You could also just quit when the user presses stop, but I assume
you want to do something else after the loop.) I'll leave adding
the start button as an exercise. ;-)
Regards,
Gabriele.
--
Gabriele Santilli <[g--santilli--tiscalinet--it]> -- REBOL Programmer
Amiga Group Italia sez. L'Aquila --- SOON: http://www.rebol.it/