Clearing local variables

Dave Cragg dcragg at lacscentre.co.uk
Mon Apr 25 10:01:27 EDT 2016


This is slight variation of Craig's solution. It works if you want to delete all local variables declared outside of handlers. (it's used inside libUrl)

on ulDeleteLocals
  local e
  repeat for each item e in line 3 of the localNames
    get "delete" && "local" && e
    do it
  end repeat
end ulDeleteLocals

Cheers
Dave

> On 22 Apr 2016, at 21:47, dunbarx at aol.com wrote:
> 
> If I understand what you are asking, step through this:
> 
> 
> 
> on mouseUp
>   put "tAllCats,tCatsTree,tRootCats,aAllCatsArray,aCatsByParent,aCatsByChild,tAllChildren" into tLocalVars
>   repeat for each item x in tLocalVars
>      do "put random(999) into" && x 
>   end repeat
> 
> 
>   breakpoint
> 
> 
>    repeat for each item x in tLocalVars
>      do "put empty into" && x 
>   end repeat
> end mouseUp
> 
> 
> The first part loads, the second part empties. 
> 





More information about the use-livecode mailing list