Newsgroups: comp.sys.mac.hypercard
Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!van-bc!ubc-cs!alberta!arcsun.arc.ab.ca!arcsun!kenw
From: kenw@skyler.arc.ab.ca (Ken Wallewein)
Subject: How to tell when really idle? 
Message-ID: <KENW.91Apr22200900@skyler.arc.ab.ca>
Sender: nobody@arc.ab.ca (Absolutely Nobody)
Organization: Alberta Research Council, Calgary Alberta, Canada
Distribution: comp.sys.mac.hypercard
Date: 22 Apr 91 20:09:00


  One of the things that's always bugged me about HyperCard is that,
although it updates most stuff to disk automatically, it won't do the same
for the current card -- at least, not doing the things I do.  A person can
loose a lot of text in a hurry if you crash without saving first.

  A while ago I decided to try to address that by writing an idle handler
that would detect how long HyperCard had been sitting idle, and if it was
longer than, say, five minutes, it would execute a "keep" (custom, of
course).

  I discovered that there appears to be no reasonable way to tell how long
HyperCard has been "consecutively" idle.  Oh, sure, one can count "idle"
messages.  Unfortunately, one needs a way to _reset_ that counter if
_anything_ _else_ happens.  Oops.  About the only way to address this right
now, as far as I can see, is to set up handlers for all the system
messages, and have them all clear a global variable.  I don't like the
overhead, and it's not foolproof.

  Does anybody have a better way to address this problem?

--
/kenw

Ken Wallewein                                                     A L B E R T A
kenw@noah.arc.ab.ca  <-- replies (if mailed) here, please       R E S E A R C H
(403)297-2660                                                     C O U N C I L

