Path: utzoo!censor!geac!torsqnt!lethe!yunexus!ists!helios.physics.utoronto.ca!news-server.csri.toronto.edu!bonnie.concordia.ca!thunder.mcrcim.mcgill.edu!snorkelwacker.mit.edu!mit-eddie!rutgers!ub.d.umn.edu!cs.umn.edu!ux.acs!clarson From: clarson@ux.acs.umn.edu (Chaz Larson) Newsgroups: comp.sys.mac.hypercard Subject: Re: Idling in pre-2.0 HC Message-ID: <3024@ux.acs.umn.edu> Date: 10 Jan 91 15:36:30 GMT References: <1991Jan10.142922.11037@usenet.ins.cwru.edu> Reply-To: clarson@ux.acs.umn.edu (Chaz Larson) Organization: Iron City, USA Lines: 62 In article <1991Jan10.142922.11037@usenet.ins.cwru.edu> mike@pyrite.SOM.CWRU.Edu (Michael Kerner) writes: |the idea is |if HC is idle for so long I want to do something. | |Well, the most straightforward (at least to me) idea was There's a basic problem here in the way you're using "idle". It's a message, not a property or variable. |on idle | put 1 into i | repeat while idle <-- this line is trouble | add 1 to i | if i > someValue then | blah blah | end if | end repeat |end idle | |however, no go. Any other ideas/ suggestions? This script will always choke on the problem line above with an "Expected true or false here" error. What you want is something like this: on idle global delay_time add 1 to delay_time if delay_time > 10 then --do whatever you want end if end idle Line by line here's what it does: on idle The "idle" message invokes the handler global delay_time This sets up a global variable "delay_time", which will hang around between invocations of the "idle" handler. If "delay_time" already exists, as it will on the second, third, etc pass through the handler, this tells the script to use the existing "delay_time" instead of setting up a new one. add 1 to delay_time Adds one to the "delay_time" variable, to count how many times we have been through this handler. if delay_time > 100 then --do whatever you want end if You'd replace 100 with an appropriate number and fill in your code. end idle Hope this helps --- Hmmm, I seem to be afflicted with that dread disease, Male OverExplaining Syndrome... chaz -- Someone please release me from this trance. clarson@ux.acs.umn.edu AOL:Crowbone