Shared function.

Share your favorite FastKeys commands
Post Reply
Kertifonis
Posts: 2
Joined: Feb 25th, ’23, 21:32

Post by Kertifonis » Feb 25th, ’23, 22:00

Good morning,
Sorry, is there a way to use the same function from different scripts, similar to the #include in C and the AutoHotKey?)
(Sorry for the Google translation, my English is bad)
Thanks in advance for any response and congratulations for the SW.
User avatar
Tom
Posts: 791
Joined: Nov 24th, ’15, 23:39

Post by Tom » Feb 26th, ’23, 11:12

If you create a function in one command it will in principle be available in all other commands as well.
Kertifonis
Posts: 2
Joined: Feb 25th, ’23, 21:32

Post by Kertifonis » Mar 4th, ’23, 10:01

Thank you very much for the answer.
nmax
Posts: 2
Joined: Nov 27th, ’23, 16:23

Post by nmax » Nov 27th, ’23, 16:42

Tom wrote: Feb 26th, ’23, 11:12 If you create a function in one command it will in principle be available in all other commands as well.
Unfortunately, when trying to create a Shortcut with Command

Code: Select all

ToolTipTest("hi",,,5000)
it says:

Code: Select all

Error:  Call to nonexistent function.

Specifically: ToolTipTest("hi",,,5000)

	Line#
	004: Return
	005: Return
--->	007: ToolTipTest("hi",,,5000)  
	008: Return
	009: Return
	010: {
	011: Return
	012: }
	013: Exit

The program will exit.
even there is another Shortcut exists and works with Command text:

Code: Select all

ToolTipTest("hi",,,5000)

ToolTipTest(S, X="", Y="", msec=1000) {
    SetTimer, Off, %msec%
    ToolTip, %S%, %X%, %Y%
    return
    
    Off:
    ToolTip
    SetTimer, Off, Off
    return
}
I even tried place the same code chunk into Tools > Startup script - no success.

I just purchased the license and it's is kinda a show stopper for me.


Can you help?

Or if there are no options so far, then I suggest add feature to have some folder like "Includes" where can be stored .ahk files with functions that are loaded and globally accessible in any command.
Thank you.
Last edited by nmax on Nov 28th, ’23, 08:31, edited 1 time in total.
User avatar
Marko
Posts: 1719
Joined: Mar 2nd, ’13, 21:02

Post by Marko » Nov 27th, ’23, 19:01

Thanks for reporting. You are right, currently it is only possible to set a procedure and not a function in the Startup Script.
We will resolve this in the next release. ;)
nmax
Posts: 2
Joined: Nov 27th, ’23, 16:23

Post by nmax » Nov 28th, ’23, 08:34

Marko wrote: Nov 27th, ’23, 19:01 Thanks for reporting. You are right, currently it is only possible to set a procedure and not a function in the Startup Script.
We will resolve this in the next release. ;)
Great, thanks! Can't wait.
Post Reply