Creating list references in handlers. Bad code or bug?
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