Variable Scoping

Robert Sneidar bobs at
Sat Oct 7 00:18:40 EDT 2006

Am I correct in stating that variables in a custom command are not  
visible to other commands and functions that it calls? In other  
words, if I put "blah" into bobtest in handler "dosomething" and then  
"dosomething" calls handler "somethingelse", is bobtest invisible to  
handler "somethingelse"? Is there any way to change this behavior? If  
not, is there any way I can lobby Runtime Revolution to consider  
adding this as a switchable option? OMHO children should inherit what  
the parent has. I see variables defined by a parent as objects  
belonging to the parent, and therefore should be visible to the parent.

Then the local declaration would have some meaning. Declaring a  
variable as local would force the behavior that is status quo now.  
Otherwise parent variables would be visible to the handlers the  
parent calls. This seems to make more sense to me. But I suspect this  
would be a huge recoding change.

I think I could mimic this behavior, but at a big performance  
penalty. I think my Foxpro port hangs on this.

Bob Sneidar
IT Manager
Logos Management
Calvary Chapel CM

More information about the Use-livecode mailing list