Re: A reference to problem (solved)
Re: A reference to problem (solved)
- Subject: Re: A reference to problem (solved)
- From: "Serge Belleudy-d'Espinose" <email@hidden>
- Date: Tue, 5 Jun 2001 03:43:43 +0200
At 13:29 -0400 4/06/01, Arthur J Knapp wrote:
>
A value created by the "a reference to" syntax creates the reference as
>
a pointer to a value from some sort of "top level" object, either an
>
application or a script. <<script>> means literally your script file.
>
>
Because of this, your "local" varaibles cannot have references made to
>
them, because references only refer to variables/properties of applications,
>
script objects, or to global/properties of the main script.
(snip)
>
on YetAnotherIdea()
>
>
script TempScript
>
property tempList : {}
>
end script
The second example is much better, it even gives me the chance to retrieve and return list values, something that the first one didn't allow if we wanted to free the memory after handler execution.
As I understand it, you're saying that my example didn't work, because I was trying to set ref to a variable local to a handler, and AS doesn't allow this. However, since AS allows refs to script properties, you're just turning the list into one of them, and voila. So, using script properties is more or less like storing the list in a different memory zone, where it can be accessed differently.
I was used to making script objects and handlers inside them, but not the other way around, handlers and script objects inside them. Interesting.
This is the definitive answer I was looking for. I love this list :)
Thanks Arthur and everybody else who answered.
Serge
--
\\//\//\// Serge Belleudy-d'Espinose Institut Jacques Monod
// // //
http://www.ijm.jussieu.fr/ Univ. Jussieu - Paris
//\//\//\\