It could be done via some flag
Code: Select all
#Warn WarnAsError
#Warn ForceExit
Code: Select all
if (A_Warn) {
ExitApp 1
}
Code: Select all
#Warn WarnAsError
#Warn ForceExit
Code: Select all
if (A_Warn) {
ExitApp 1
}
Code: Select all
FileAppend % "#Warn All, StdOut`na:=b+1", temp.ahk
Code: Select all
"C:\Program Files\AutoHotkey\AutoHotkey.exe" /ErrorStdOut "My Script.ahk" 2>"Syntax-Error Log.txt"
Code: Select all
Try {
;your code here
DllCall("IDon'tExist")
} Catch e {
Throw e
}
Code: Select all
#Warn All, StdOut
if (A_Year == 2021) {
someVariable := variableThatDoesNotExist
}
UseUnset (and UseEnv) is not feasible to detect at load time. The other warnings are made during load time. This is documented,Also, it seems that warning analysis is done during runtime instead of the parsing phase
Cheers.#warn wrote: UseUnsetLocal or UseUnsetGlobal: Warn when a variable is read
UseEnv: Warn when an environment variable is automatically used in place of an empty script variable
LocalSameAsGlobal: Before the script starts to run, display a warning for each undeclared local variable which has the same name as a global variable
ClassOverwrite [v1.1.27+]: Before the script starts to run, show a warning for each assignment targetting a class variable
Code: Select all
F() ? X := 1 : ""
Y := X
Code: Select all
myVar := new ClassThatDoesNotExist()
Users browsing this forum: No registered users and 38 guests