Strict Compile Mode
bobs at twft.com
Thu Oct 11 18:03:51 EDT 2012
I don't think that is true Pete. I think you DO have to define a global, either in the script or in the handler in order for it to be treated as such. What is causing the shadow variable glitch I don't know.
I personally don't like using strict compile, but I understand it's really a personal preference, and may become more useful the bigger a project gets. But my solution for mistyping a variable is the same as the doctor who is told by his patient that his shoulder hurts when he moves it "like this." The doctor replies, "Well don't do that!"
On Oct 11, 2012, at 2:26 PM, Peter Haworth wrote:
> 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?
More information about the Use-livecode