• 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
Creating list references in handlers. Bad code or bug?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Creating list references in handlers. Bad code or bug?


  • Subject: Creating list references in handlers. Bad code or bug?
  • From: Paul Skinner <email@hidden>
  • Date: Fri, 14 Sep 2001 09:38:33 -0400

Can anyone point out my error, or is this a bug?

theHandler()

on theHandler()
set theList to {1, 2, 3}
set listReference to a reference to theList
return listReference
-->theList of +script;
end theHandler

This seems normal, but I want the actual contents of the list, so...

theHandler()

on theHandler()
set theList to {1, 2, 3}
set listReference to a reference to theList
--get the contents of the listReference
-->Error -1700: Can't make some data into the expected type.
end theHandler

I can't find any reference to (no pun intended) creating references
inside of handlers in the ASLG. I assume there's no rule that I shouldn't do
this.
I find that I can get the listReference's contents if the reference is
created outside the handler and passed in...

set theList to {1, 2, 3}
set listReference to a reference to theList
theHandler(listReference)

on theHandler(listReference)
get the contents of the listReference
-->{1,2,3}
end theHandler

Can anyone get this second example to return {1,2,3} in any AS
version/OS version?

--
Paul Skinner


  • Prev by Date: Re: Sudden unusual behaviour with tell app commands
  • Next by Date: Re: applescript-users digest, Vol 2 #1064 - 14 msgs
  • Previous by thread: OT - Your Comments on the recent,,, URL
  • Next by thread: Re: Creating list references in handlers. Bad code or bug?
  • Index(es):
    • Date
    • Thread