Script local variables

Bob Sneidar bobsneidar at iotecdigital.com
Sun Feb 23 17:31:01 EST 2014


Right, otherwise CONSTANT would just be another name for VARIABLE. 

Bob


On Feb 23, 2014, at 11:14 , J. Landman Gay <jacque at hyperactivesw.com> wrote:

> On 2/23/14, 4:30 AM, Graham Samuel wrote:
>> I've just read that bit of the dictionary and I'm equally surprised.
>> I also think I  must have completely misunderstood it, because I
>> can't see how it can work. The value of a script local variable
>> (unless it's predefined using an '=' construction) is undefined until
>> a script is run, and is then only defined when an executing script
>> puts something into the variable. A script can only be run when the
>> program is executing. When the program containing the script quits,
>> any information in variables, global or local, is lost because one
>> can't normally save an executable stack outside the IDE (yes, I know
>> about splash stacks and such, but the principle is correct). So next
>> time the script is compiled, we **must** be back at square one, and
>> the value of local variables **cannot** be maintained. What's wrong
>> with this thinking?
> 
> Since I just discovered this, I'm trying to figure it out too. There must be a difference between declaring a constant and declaring a variable. So the only thing I can think of is that a script local variable can be altered by different handlers in the script, where a constant cannot. I.e., the value declaration is a starting point but isn't a fixed immutable value the way a constant is.
> 
> I haven't tried it yet, maybe someone else can confirm.
> 
> -- 
> Jacqueline Landman Gay         |     jacque at hyperactivesw.com
> HyperActive Software           |     http://www.hyperactivesw.com
> 
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode





More information about the use-livecode mailing list