• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Stay Open
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Stay Open


  • Subject: Re: Stay Open
  • From: email@hidden
  • Date: Thu, 11 Jan 2001 16:52:17 -0500

On Thu, 11 Jan 2001 05:33:12 -0500, Xandra Lee <email@hidden> asked,

> Some really dumb idle questions:
> 1. Do scripts with idle routines always begin with a run statement
> ie:
> on Run
> idle
> end Run

No, but it doesn't hurt. You might have a situation where on startup you want
to do some initialization, invoke the idle handler, and finish up the
initialization.

on run
-- Initialize here
idle
display dialog "Status of something:" & blahblah
end run

> 2. Can you pass parameters to idle handlers
> ie:
> set x to 15
>
> on idle(x)
> set y to (x + 20)
> return y
> end idle

No. The applet shell calls the idle handler without any arguments, so if you
wrote an idle handler that needed an argument, it would give a "Missing
parameter" error.

> 3. Can an idle handle return any variable besides the time it should idle?

No. The applet shell is expecting the sleep time, and would puke if it got
something else.

It sounds like you have some function that you want to call in the run handler
and also in the idle handler. Try structuring it like this:

property a : 42
property b : 0
on run
-- Initialize here
set a to foo(x,y)
end run

on idle
set b to foo(x,y)
end idle

--
Scott Norton Phone: +1-703-299-1656
DTI Associates, Inc. Fax: +1-703-706-0476
2920 South Glebe Road Internet: email@hidden
Arlington, VA 22206-2768 or email@hidden


  • Prev by Date: Creating a new contact in Palm Desktop
  • Next by Date: Moving the files!!!!!!!!!!!!
  • Previous by thread: Re: Stay Open
  • Next by thread: Re: Stay Open
  • Index(es):
    • Date
    • Thread