Strict Compile Mode Utility

Peter Haworth pete at lcsql.com
Thu Dec 13 21:49:35 EST 2012


A few weeks back, I switched over to using Strict Compile Mode in all my
applications.  SInce very few of my scripts declared any local variables,
it was a time consuming task to get them all to compile error free.

I ended up writing a utility to help with the task and am making is
available free to anyone who cares to use it.  The stack name is setLocals
and you can download it from my web
site<http://www.lcsql.com/utilities.html#lcstackbrowser>
.

It's currently set up to work in conjunction with my lcStackbrowser plugin
but that can be changed by altering a couple of lines of code to define the
object whose script you want to update (the stack is not password
protected).

The Help for the stack will explain in detail how it works but the basics
are that it will analyze the script of any object you point it to, and list
the "local" statements required to declare all the variables in each
handler.  It will also insert the local statements into a copy of the
script and "Apply" it, listing any compile errors that might occur.

It saved me a good number of hours of tracking down undeclared variables
and hope it might help anyone going through the same process.  Feel free to
adapt it as appropriate.  I'll try to answer questions about it as time
permits.


Pete
lcSQL Software <http://www.lcsql.com>



More information about the use-livecode mailing list