alerts
Peter Brigham MD
pmbrig at gmail.com
Thu Nov 11 23:21:02 EST 2010
On Nov 11, 2010, at 6:15 PM, Mark Smith wrote:
>
>
> Peter Brigham MD wrote:
>>
>> The saving of the time in a customProp is because I have scripted
>> things so the stack is automatically saved every 20 minutes, or at
>> whatever interval the user chooses in the preferences. That feature
>> was irrelevant to your question and I could have taken it out,
>> probably should have to avoid confusing you....
>>
>>
>
> HI Peter, I'm glad you didn't. While I won't need it in the current
> project
> I'll archive it as i'm sure it will come in handy eventually.
> However, rev
> does not seem to be an environment that supports something like a
> "main
> event loop" so either you are checking the time from lots of different
> places or using some other technique? (can you set an "On every 10
> mins
> do... handler?")
I have a "checkSave" handler triggered by any change of card or change
of background or clicking of the "print" button. The handler checks to
see how long since the last save and saves the stack if > 20 mins (or
whatever, from the preferences). I had originally thought of using a
timed loop, like:
send "doSave" to this stack in (uPrefSaveInterval * 60) seconds
but that way the save could happen in the middle of the user entering
text, so I elected to trigger it by user actions that could be delayed
by 1-2 seconds without annoying the user too much.
In general, the best way of having a "main event loop," as you called
it, is to use the "sent in time" command -- see the "send entry in the
dictionary. In this case, there would be a major disadvantage to doing
it that way.
-- Peter
Peter M. Brigham
pmbrig at gmail.com
http://home.comcast.net/~pmbrig
More information about the use-livecode
mailing list