Hotkey call BUG Topic is solved

Get help with using AutoHotkey (v2 or newer) and its commands and hotkeys
_3D_
Posts: 277
Joined: 29 Jan 2014, 14:40

Hotkey call BUG

04 Mar 2019, 13:25

The main code that work:

Code: Select all

Gosub("T")
T::tooltip("T")
BUT let see the next code:

Code: Select all

function("T", ()=>tooltip("T"))
function(h, f) {
	Hotkey(h, f)
}
Gosub("T")
A function that create Hotkey.

Code: Select all

---------------------------
ahk-test-code-2.ahk
---------------------------
Error:  Target label does not exist.

Specifically: T

	Line#
	004: {
	004: Return tooltip("T")
	004: }
	004: function("T", ()=>tooltip("T"))
	005: {
	006: Hotkey(h, f)
	007: }
--->	008: Gosub "T"
	009: Exit
	010: Exit
	010: Exit

The program will exit.
---------------------------
OK   
---------------------------
When no Gosub - when I press T then hotkey works.
When Gosub - error.
Why?
AHKv2.0 alpha forever.
Helgef
Posts: 4709
Joined: 17 Jul 2016, 01:02
Contact:

Re: Hotkey call BUG  Topic is solved

04 Mar 2019, 13:40

As the message says, the label doesn't exist. T::... creates a label, you can't create a label at run time. This is no bug.

Cheers.
_3D_
Posts: 277
Joined: 29 Jan 2014, 14:40

Re: Hotkey call BUG

05 Mar 2019, 01:54

Thanks Helgef.
In other words I can't access list of hotkeys, created with Hotkey(), and call its corresponding actions.
AHKv2.0 alpha forever.

Return to “Ask for Help (v2)”

Who is online

Users browsing this forum: Draken and 44 guests