Vous êtes sur la page 1sur 1

LocalSameAsGlobal: Before the script starts to run, display a warning for each undeclared local

variable which has the same name as a global variable. This is intended to prevent errors caused
by forgetting to declare a global variable inside a function before attempting to access it. If the
variable really was intended to be local, a declaration such as local x or static y can be used
to suppress the warning.
g := 1
ShowG() { ; The warning is displayed even if the function is never
;global g ; <-- This is required to access the global variable.
MsgBox % g ; Without the declaration, "g" is an empty local variable.
All: Apply the given WarningMode to all supported warning types.