• 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
Calling handlers by reference
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Calling handlers by reference


  • Subject: Calling handlers by reference
  • From: Michael Ellis <email@hidden>
  • Date: Sat, 19 May 2001 17:33:29 -0400

Hi folks.

I have been scouring the AppleScript documentation for syntax that would
allow me to call a handler by reference. I think an example would help
illustrate what I'd like to do:

-- BEGIN EXAMPLE --

on HelloWorld()
log "Hello world!"
end HelloWorld

set helloWorldRef to a reference to HelloWorld
(helloWorldRef as handler)()


-- END EXAMPLE --

Basically I am trying to store refernces to handlers in variables so that
I can use them like callback pointers. I think AppleScript can do this,
because if you ask AppleScript:

log class of HelloWorld

it will report "handler". It seems like I ought to be able to coerce a
reference to a handler and then call it.

Does anyone have any experience doing this?

(BTW, sorry if this is a common question -- the archives are not yet
searchable and they date back to 1995).

Thanks for any help.

-Mike Ellis



==========================================================================
Michael Ellis Phone: 941-377-5562 x5169
Systems Analyst Manager FAX: 941-377-5590
Medical Education Technologies, Inc. (METI) Internet: email@hidden


  • Prev by Date: WWDC
  • Next by Date: Re: WWDC
  • Previous by thread: Re: WWDC
  • Next by thread: Re: Calling handlers by reference
  • Index(es):
    • Date
    • Thread