• 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: Sun, 15 Apr 2001 00:26:38 -0500

pardon me for the double-posting, but some characters got mangled in the original post. In the following script, the character combinations << and >> should be entered into Script Editor as left and right chevrons (or right and left; I forget which is which). The charcters << can be achieved as single chevron character by typing "Option-\" and the characters >> can be achieved as a single chevron character by typing "Option-Shift-\".

Original post (corrected for mangled characters) follows:

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


  • Prev by Date: Re: CGI?
  • Next by Date: Trapping aete's
  • Previous by thread: Trapping aete's
  • Next by thread: Re: Coerce String to Handler?
  • Index(es):
    • Date
    • Thread