Problem with declaring local variables

Jim Ault JimAultWins at yahoo.com
Wed Jun 7 14:38:09 EDT 2006


On 6/7/06 8:00 AM, "Peter T. Evensen" <pevensen at siboneylg.com> wrote:

> On your second point, do you mean a declared local variable OUTSIDE a
> handler?    I think you are confusing a declared local variable INSIDE a
> handler with one that is declared OUTSIDE a handler.
> 
> I don't believe one declare INSIDE a script retains its value:

You are correct.
global, script local, handler local

Some on this list have adopted naming conventions to make this clear in
their code what their intentions are:

gVarname = global
tVarname or lVarname or hVarname= handler local  ( t = temporary)
sVarname or lVarname = script local
pVarname = parameter passed to the handler
@Varname = the reference form used let a handler know the memory location
rather than make a copy of a large variable

I am sure there are many others, as we all adopt our own precise conventions
steeped in wisdom :-)

Jim Ault
Las Vegas





More information about the use-livecode mailing list