Quote from Reinier Maliepaard on October 20, 2023, 7:16 pmHi,
I'm rebuilding and extending my MC Musiceditor (mcmusiceditor.com). About one extension I like to discuss with you. MCM has x menuitems. Each menuitem has y submenu-items. These items contain useful information for a user. I want to make a searchbox so a user can search on a topic (e.g. Beams) and becomes as answer the (sub)menu place where to find the requested info (e.g. Rhythm > Beams; maybe a deep link is possible but I do not know yet). I try not to reinvent the wheel, so my question: has anyone made such Menu searchtool that can be shared?If not, I'll make a hash/key-value/associative array in newLisp (with the excellent plugin from Hans-Peter Wickern) and that should do the job: searching on a key and returning its associated value. And in that case, I'll let you know how I did this. Thanks.Best regards,Reinier
Hi,

Quote from luishp on October 21, 2023, 1:37 pm@reinier I think you can mimic associative arrays in VisualNEO Win this way:
.Set pairs key / value Loop "1" "10" "[X]" SetVar "[VarKey[X]]" "Key name [X]" SetVar "[VarValue[X]]" "Key value [X]" EndLoop .Search for specific value Loop "1" "10" "[X]" If "[VarValue[X]]" "=" "Key value 2" AlertBox "Results" "Key value found in Key name [X]" EndIf EndLoopNot sure if this is what you are looking for.
Regards.
@reinier I think you can mimic associative arrays in VisualNEO Win this way:
.Set pairs key / value
Loop "1" "10" "[X]"
SetVar "[VarKey[X]]" "Key name [X]"
SetVar "[VarValue[X]]" "Key value [X]"
EndLoop
.Search for specific value
Loop "1" "10" "[X]"
If "[VarValue[X]]" "=" "Key value 2"
AlertBox "Results" "Key value found in Key name [X]"
EndIf
EndLoop
Not sure if this is what you are looking for.
Regards.
Quote from Reinier Maliepaard on October 22, 2023, 2:52 pmThanks Luis. Much appreciated!
Yes, you could mimic associative arrays in that way. Maybe that the search-speed in the newLisp solution is much better when the number of items is big (I don't know yet how many items are involved). As far as I can see, it seems to me that invoking Menuitems and Submenitems (and possibly some content behind the (sub)menuitems) by some command (aka GetMenuItem, GetSubmenuitem and GetContentsSubmenuitem) is not possible within VisualNeoWin. So my search engine will be based on an array, which has to be created manually. If I've made it, I'll inform you about both solutions (VisualNeoWin and newLisp) and their performance.
Best regards,
Reinier
Thanks Luis. Much appreciated!
Yes, you could mimic associative arrays in that way. Maybe that the search-speed in the newLisp solution is much better when the number of items is big (I don't know yet how many items are involved). As far as I can see, it seems to me that invoking Menuitems and Submenitems (and possibly some content behind the (sub)menuitems) by some command (aka GetMenuItem, GetSubmenuitem and GetContentsSubmenuitem) is not possible within VisualNeoWin. So my search engine will be based on an array, which has to be created manually. If I've made it, I'll inform you about both solutions (VisualNeoWin and newLisp) and their performance.
Best regards,
Reinier
Quote from Gaev on October 23, 2023, 2:55 am@reinier
I have not deployed the VNWin menu component before.
However, I played around with it last night, and might be able to suggest a solution (tip: menuHeading, menuItem and MenuSubitem labels can be specified as [variables])
Before I post something, can you advise if you require your menu structure to consist of just one MenuHeading (with all your MenuItems and MenuSubItems under this single Heading) ... or have you considered having a structure with multiple MenuHeadings ?
I have not deployed the VNWin menu component before.
However, I played around with it last night, and might be able to suggest a solution (tip: menuHeading, menuItem and MenuSubitem labels can be specified as [variables])
Before I post something, can you advise if you require your menu structure to consist of just one MenuHeading (with all your MenuItems and MenuSubItems under this single Heading) ... or have you considered having a structure with multiple MenuHeadings ?
Quote from Reinier Maliepaard on October 24, 2023, 5:42 pm@gaev
Thanks Gaev! Now I'm working on a little demo application with all functionality. I'll post it here if it is ready and I'm then curious if things can be done better.
Thanks Gaev! Now I'm working on a little demo application with all functionality. I'll post it here if it is ready and I'm then curious if things can be done better.
Quote from Gaev on October 24, 2023, 5:51 pm@reinier
I'll post it here if it is ready and I'm then curious if things can be done better.
OK.
After my last post, I did some more thinking and wondered ...
- do you have a guesstimate of the values for x and y ? ... 5 ? or 50 ? ... or 500 ? ... keep in mind that there might be (undocumented) limits on the number of such items.
- is there a specific purpose for deploying the Menu object for what you need ? ... or could a database (using neoDBPro plugin) be a better choice ?
I'll post it here if it is ready and I'm then curious if things can be done better.
OK.
After my last post, I did some more thinking and wondered ...
- do you have a guesstimate of the values for x and y ? ... 5 ? or 50 ? ... or 500 ? ... keep in mind that there might be (undocumented) limits on the number of such items.
- is there a specific purpose for deploying the Menu object for what you need ? ... or could a database (using neoDBPro plugin) be a better choice ?
Quote from Reinier Maliepaard on October 24, 2023, 6:09 pm@gaev
Thanks again. My demo will make all clear, I hope. Let's talk then further about the what, the how and the why.
Thanks again. My demo will make all clear, I hope. Let's talk then further about the what, the how and the why.
Quote from Reinier Maliepaard on October 31, 2023, 9:24 pm@gaev
My (sub)menu-search-tool solution till now: https://reiniermaliepaard.nl/app/
Best regards,
Reinier
My (sub)menu-search-tool solution till now: https://reiniermaliepaard.nl/app/
Best regards,
Reinier