Re: Creating list references in handlers. Bad code or bug?
Re: Creating list references in handlers. Bad code or bug?
- Subject: Re: Creating list references in handlers. Bad code or bug?
- From: Victor Yee <email@hidden>
- Date: Fri, 14 Sep 2001 12:21:24 -0400
On Fri, 14 Sep 2001 17:50:12 +0200, Helmut Fuchs wrote,
>
At 10:26 Uhr -0400 14.09.2001, Victor Yee wrote:
>
>I think that the problem is a matter of scope. References can only
>
>refer to top-level or global varaibles.
>
>
Not completely true.
>
>
Run this:
[...]
>
The reference
>
from the handler above works like this: look up the property named
>
"theList" from {theList:{1, 2, 3}}. And this always works!
Hmm... very interesting. It had been noted before that you could reference a script object in a similar way:
on theHandler()
script theData
property theList : {1, 2, 3}
end script
set theListReference to a reference to theList of theData
return contents of theListReference
end theHandler
theHandler()
--> {1, 2, 3}
So records are treated in a like manner?
By the way, I've never played with this type of structure and was wondering how people use it?
Victor