Shared function.
-
Kertifonis
- Posts: 2
- Joined: Feb 25th, ’23, 21:32
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.
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.
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
Thank you very much for the answer.
Unfortunately, when trying to create a Shortcut with Command
Code: Select all
ToolTipTest("hi",,,5000)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.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 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.
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.
We will resolve this in the next release.
From https://www.fastkeysautomation.com/foru ... php?t=2367, I see that "Startup script can now contain functions and subroutines", so I take it that we should be able to define a function in startup script and re-use it in a text expander command.
But when I try to do that, I keep encountering the "Call to nonexistent function" error, as if the problem reported above was never resolved. I'm on the latest version of fastkeys.
Could you maybe give me a simple example of how a function can be defined in startup script and then re-used? This is not mentioned in the documentation as of now.
Thanks!
We are aware of this issue and it has not been resolved yet. It is stillonly possible to set a procedure and not a function in the Startup Script.
We will try to resolve it asap.
We will try to resolve it asap.
Well in that case can you please let me know once the issue is resolved? I do monitor this thread, as well as the release notes, so I'd appreciate it if you could mention the fix in either place once it happens.
Being able to use function in the Startup Script would save me a lot of duplicate code, so I really look forward to the fix. Thanks!
I confirm this now works in version 6.05.
