04-30-2012 04:56 AM - edited 04-30-2012 05:00 AM
Hi Chris,
let's tackle this from a different point of view:
- Let's assume you have a nice binary search tree and your user can add leaves to the tree identified by "tags".
- The user fails to add unique tags, providing information for two or more leaves under the same tag.
- Subsequently the user tries to get information from the tree providing those non-unique tags. Which leaves will you find in your tree?
I will not say I know/understand the underlying algorithm of the menu implementation in LabVIEW, but I assume it's a similar scheme as described here.
Make your own decision on how to handle the problem...
"we wouldn't have to worry about the issue of having identical sub-menu's"
This isn't an issue. You can present identical sub-menus to the user - as long as you use unique tags internally. There's a reason to differentiate between tags and names... (Well, it's the same with FP elements label and caption: you should not use the same label for different elements, but you may use the same caption anywhere.)
04-30-2012 05:05 AM
Hi GerdW,
That is true if you are searching just on Tags, but I'm saying search on the COMPLETE path to that the Tag.
eg. If I have these two Main Menu's each with the same identical sub-menu's:
ADD Facility
1
2
3
REMOVE Facility
1
2
3
What's wrong in LabVIEW returning ADD Facility:1 or REMOVE Facility:1? Instead LabVIEW returns ADD Facility:1 regardless of which sub-menu item I select.
Chris
04-30-2012 05:16 AM - edited 04-30-2012 05:17 AM
Hi Chris,
the LabVIEW help says: use (unique) tags to identify menu items. (Yes, the tags are mandatory in Menu functions. No, the names are not...)
When you want to change that behaviour you're are free to add an idea to the LabVIEW idea exchange. I doubt, NI will change a behaviour where a lot of programmers rely on. The best you will probably get is a more precise documentation/context help...
04-30-2012 09:51 AM
I'm not going to debate whether a programmer should be forced to use unique tags, or LabVIEW is still able to return what the programmer wants if he does not use unique tags.
My question is that there seems to be a difference between the behavior for the menu at the top of that application (like in the link I posted) and an object's shortcut menu.
The application menu seems to automatically add a suffix such as (_1) in the event the programmer does not provided a unique tag. But the shortcut menu does not automatically add a suffix. It adds the duplicated tag (although they are different items under different branches of the menu tree.) This behavior seems inconsistent.
05-01-2012 06:50 PM
Hi Ravens Fan,
It does seem that you have come across some strange behavior. I'm going to look into this and see if I can get everybody a better answer.