Page 2 of 2

Re: what are some ahk programming mistakes that tend to 'fail silently' with no warning and took you a long time to catc

Posted: 12 Oct 2019, 15:30
by SpeedMaster
Goto vs Gosub hidden crash :twisted:
(thanks rommmcek)

Code: Select all

;tested on AHK 1.1.31.00 Unicode x32 on WIN_7 64bit


count:=0

gui, font, s18
gui, add, text,w500 h200, Press Q = crash with gosub`nPress A = no crash with goto
gui, show 
return

repeat_with_gosub:

q::
tooltip, % ++count
gosub, repeat_with_gosub
return

repeat_with_goto:

a::
tooltip, % ++count
goto, repeat_with_goto
return

guiclose: 
esc:: 
exitapp 
return