Calling handlers by reference
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