early exit from #Warn loadtime error messages
Posted: 02 Dec 2019, 21:34
If you use #Warn, and have local variables (not defined as local) with the same names as global variables, in a script, you can get a long stream of loadtime error messages.
This is a recurring problem when adding #Warn to old scripts, or using/including scripts by other people.
Note: at loadtime, there is no AHK tray icon with which to close the script.
Possible solutions could be:
- add a 'No' button to the MsgBox, to allow you to close the script
- state the script's PID in the loadtime error messages, so that you can find the AHK process in Task Manager and close it that way
Btw, is there any tidy way to close AHK during those loadtime messages, or must you force close the process? Thanks.
This is a recurring problem when adding #Warn to old scripts, or using/including scripts by other people.
Code: Select all
#Warn
a := b := c := d := e := ""
f := g := h := i := j := ""
k := l := m := n := o := ""
p := q := r := s := t := ""
u := v := w := x := y := ""
z := ""
return
MyFunc()
{
;local ;add this line to prevent the error messages
a := b := c := d := e := ""
f := g := h := i := j := ""
k := l := m := n := o := ""
p := q := r := s := t := ""
u := v := w := x := y := ""
z := ""
}
Note: at loadtime, there is no AHK tray icon with which to close the script.
Possible solutions could be:
- add a 'No' button to the MsgBox, to allow you to close the script
- state the script's PID in the loadtime error messages, so that you can find the AHK process in Task Manager and close it that way
Btw, is there any tidy way to close AHK during those loadtime messages, or must you force close the process? Thanks.