Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changed menus to call func instead of subroutines #35

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

spice3d
Copy link

@spice3d spice3d commented Aug 1, 2023

It was a bit tough because the code uses subroutines and not functions. Here's what I did to get it to work:
-Negated the IF statement where the menu gets created so it adds the menu item when it knows the query
-Added a handler that binds the query to a new function called OpenPluginHelper
-Subtract 1 from the Array[] so it uses the title in the menu text
-Replace menuitemcount with handler variable in menu add
-Commented out the ELSE section since we don't need the queryname# variables anymore
-Declared queryname as a global variable. You have to do this before it's used in the OpenPluginHelper function as variables in functions are local by default and the openplugin subroutine needs it to run. Note that subroutines, don't have this "limitation" even if called from within a function, like we are doing.
-Added the OpenPluginHelper function. This sets the queryname (global) variable and calls the openplugin subroutine.
-Commented out the #include menuindex.ahk line :-D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant