early exit from #Warn loadtime error messages

Propose new features and changes
User avatar
jeeswg
Posts: 6902
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
User avatar
Cerberus
Posts: 169
Joined: 12 Jan 2016, 15:46

Re: early exit from #Warn loadtime error messages

15 Jan 2020, 23:28

I have experienced this issue as well, would be nice if some fix or work-around were introduced at some point.
User avatar
lmstearn
Posts: 334
Joined: 11 Aug 2016, 02:32
GitHub: lmstearn
Contact:

Re: early exit from #Warn loadtime error messages

16 Jan 2020, 21:21

Doesn't this do anything?

Code: Select all

#Warn, LocalSameAsGlobal,  Off
Recommended use is for a debugger:

Code: Select all

#Warn All, OutputDebug
#Warn, LocalSameAsGlobal,  Off
:arrow: itros "ylbbub eht tuO kaerB" a ni kcuts m'I pleH

Return to “Wish List”

Who is online

Users browsing this forum: No registered users and 18 guests