how to check for unnecessary local declarations?

Bob Sneidar bobsneidar at iotecdigital.com
Wed Jul 1 17:47:23 EDT 2015


Seems you could write a handler to do it pretty easily. 

<pseudocode>
— get stack script
— find “local “
— get word 2 of found line
— filter with “*” & word 2 of found line & “*”
— count number of lines. if only 1 then delete that line
— get list of cards
— repeat for every card
— get card script
— what I just said
— get list of objects on card
— repeat for every object on card
— get script of object
— do I have to repeat myself again?? 
</pseudocode>

It might be a little more complicated if you have multiple local variable declarations, but not much. 

Bob S


> On Jul 1, 2015, at 06:44 , Tiemo Hollmann TB <toolbook at kestner.de> wrote:
> 
> Hello,
> 
> I am using the strict compilation mode. When working over longer time on a
> project it regularly happens that I have orphaned local variable
> declarations.
> 
> Actually they don't hurt, but I like to keep my code clean and wonder if
> there is any hidden feature, which checks for not any more needed local
> declarations (beside scripting a check myself)?
> 
> Thanks
> 
> Tiemo
> 
> 
> 
> 
> 
> 
> 
> _______________________________________________
> 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