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

Put simple Tips and Tricks that are not entire Tutorials in this forum
User avatar
SpeedMaster
Posts: 494
Joined: 12 Nov 2016, 16:09

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

12 Oct 2019, 15:30

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


Return to “Tips and Tricks (v1)”

Who is online

Users browsing this forum: No registered users and 43 guests