Strict Compile Mode

Peter Haworth pete at lcsql.com
Thu Oct 11 17:26:36 EDT 2012


Hi Mark,
Checked my global definitions and there were none for the variable in
question, but Guglielmo's suggestion worked for me.

However, this puts another little gotcha into the whole area of global
definitions.  Before starting to use strict compile mode, I've been bitten
by referring to a global var in a script and forgetting to define it as a
global so it was treated as a local.  But you seem to be suggesting that LC
is aware of the existence of a global var even if it's not defined in a
script?  If that's the case, then I wonder why it's necessary to define
them in any script that uses them instead of just once?

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



On Thu, Oct 11, 2012 at 10:28 AM, Mark Wieder <mwieder at ahsoftware.net>wrote:

> Pete-
>
> Thursday, October 11, 2012, 10:18:25 AM, you wrote:
>
> > I checked all my the local commands in the script and they are all within
> > handlers except for one and it does not refer to the variable named in
> the
> > error message.  There are no global definitions in the script.
>
> Check to see if there's a global by that name. Doesn't have to be in
> the same script, globals declared by a different script as still,
> well, global. I've had the "shadows another variable or constant"
> error message come up when converting globals to script-local vars.
>
> --
> -Mark Wieder
>  mwieder at ahsoftware.net
>
>
> _______________________________________________
> 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