• 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: Coerce String to Handler?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Coerce String to Handler?


  • Subject: Re: Coerce String to Handler?
  • From: "Neal A. Crocker" <email@hidden>
  • Date: Sat, 14 Apr 2001 23:43:00 -0500

Try the following:

on makereference(propname, target)
script refscript
--{class:reference,+class form;:+constant ****usrp;, +class want;:+class prop;, +class seld;:propname, +class from;:target}
{class:reference, +class form;:+constant ****usrp;, +class want;:property, +class seld;:propname, from:target} -- this line won't compile. replace with line above to compile
end script
run script refscript
end makereference

set blah to makereference("bar", {bar:2})
{blah, blah + 1} -- {bar of {bar:2}, 3}



Subject: Coerce String to Handler?
To: <email@hidden>
From: Ehsan Saffari <email@hidden>
Date: Fri, 13 Apr 2001 08:53:54 -0600


Hi

Is it possible to coerce a string to a handler name
so the handler can be executed?

set x to "iac"
my handler x()
--> Can't make "iac" into a handler.

on iac()
beep
end iac

cheers
ehsan


  • Follow-Ups:
    • Trapping aete's
      • From: Greg Strange <email@hidden>
  • Prev by Date: Re: How to reliably get an application's creator type on MacOS X
  • Next by Date: Re: CGI?
  • Previous by thread: Re: Coerce String to Handler?
  • Next by thread: Trapping aete's
  • Index(es):
    • Date
    • Thread