gosub to label not working Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
pgeugene
Posts: 40
Joined: 27 Jun 2019, 04:36

gosub to label not working

20 May 2024, 04:15

I am trying to modify the way the GUI is opened but no Gui is opened.
Thank you for your help

From:

Code: Select all

hotkey,^',Label_DrawGui_KyRun
To:

Code: Select all

^F8::gosub, Label_DrawGui_KyRun
Source:
https://gitee.com/kawvin/kyrun/blob/master/KyRun.ahk
User avatar
V0RT3X
Posts: 245
Joined: 20 May 2023, 21:59
Contact:

Re: gosub to label not working

20 May 2024, 06:29

I don't know about the rest of your script, but maybe try...

Code: Select all

^F8::
gosub, Label_DrawGui_KyRun

Assuming you didn't forget to add the sub... (I personally do that a lot)

Code: Select all

Label_DrawGui_KyRun:
pgeugene
Posts: 40
Joined: 27 Jun 2019, 04:36

Re: gosub to label not working

21 May 2024, 01:39

V0RT3X wrote:
20 May 2024, 06:29
I don't know about the rest of your script, but maybe try...

Code: Select all

^F8::
gosub, Label_DrawGui_KyRun
Tried your method but not working.

Assuming you didn't forget to add the sub... (I personally do that a lot)

Code: Select all

Label_DrawGui_KyRun:
Confirmed it is added

Below is some of the code

Code: Select all

hotkey, ^/, Label_DrawGui_KyRun
/*
^F8::
gosub, Label_DrawGui_KyRun
*/


	; hotkey, ^[, Label_DrawGui_KyRun
	; 配合参数调用,跳过注册热键
	if  0>0
		gosub,Label_Main
return
;}

Label_Main:	;{ 运行脚本
	if  0>0
	{
		aPara=%1%
		if 2!=
			bPara=%2%
		else
			bPara:=""
	}
;}

Label_DrawGui_KyRun: ;{ KyRun主窗体
	Menu Tray, Icon, %A_ScriptDir%\KyRun.ico
	try
		Gui, KyRun:Destroy
	Gui, KyRun:+AlwaysOnTop +LastFound ;-Caption

User avatar
CoffeeChaton
Posts: 37
Joined: 11 May 2024, 10:50

Re: gosub to label not working

21 May 2024, 05:15

Code: Select all

; hotkey, ^/, Label_DrawGui_KyRun
hotkey, ^\, Label_DrawGui_KyRun
hotkey, ^NumpadDiv, Label_DrawGui_KyRun

if  0>0
    gosub, Label_Main
return
;}

Label_Main:
    if  0>0
    {
        aPara=%1%
        if 2 != 
            bPara=%2%
        else
            bPara := ""
    }
    ;}
Return

Label_DrawGui_KyRun:
    Menu, Tray, Icon, %A_ScriptDir%\KyRun.ico
    try
        Gui, KyRun:Destroy
    Gui, KyRun:+AlwaysOnTop +LastFound ;-Caption

    Gui, KyRun:Add,text, ,% "text text"
    Gui, KyRun:Show
Return

1.
KyRun: has no content and it is not used Gui, Show

try add some text ?

2.
hotkey, ^/ --> ^\ or^NumpadDiv
pgeugene
Posts: 40
Joined: 27 Jun 2019, 04:36

Re: gosub to label not working  Topic is solved

22 May 2024, 03:23

I got it working with

Code: Select all

^F8::goto, Label_DrawGui_KyRun

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: arrondark, mikeyww, Noitalommi_2, Zedcars and 202 guests