early exit from #Warn loadtime error messages

Propose new features and changes
User avatar
jeeswg
Posts: 6904
Joined: 19 Dec 2016, 01:58
Location: UK

early exit from #Warn loadtime error messages

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.

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.
homepage | tutorials | wish list | fun threads | donate
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA

Return to “Wish List”

Who is online

Users browsing this forum: Bad husband and 11 guests