LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Insert Menu Items Function: "after item" uniqueness not ensured, bug?

When creating your own shortcut menu, a "Replace Item Tag" function would be handy. Is there something like that around? (I mean really to replace an Item Tag, not the Item Name, which I saw is doable with the "Set Menu Item Info" function.)

 

The reason for my programmatic Item Tag replacement is, that I would like to replace the Item Tag in order to pass conditionally some information via Menu Item Tag over to the Event Shortcut Menu Selection (User).

 

 

To replace an Item Tag I see a two way step, by first removing an Item Tag and then inserting a new Item Tag. There's the "Insert Menu Item Function" with the "after item" connector. But what if the "after item" is an "app_separator", and I have several app separators? According to the Labview help, they should be unique: "You can insert a separator using the application tag APP_SEPARATOR. The function always ensures that the tags of all the inserted menu items are unique to the menu hierarchy by appending numbers to the supplied tags, if necessary." 

 

-> So I would expect to see such appended numbers at the supplied tags, but i don't see them. Is this a bug or am I understanding something wrong?

 

I would like to have the 2nd App Separator as reference to insert a Tag, but as every App Separator comes out in the "item tags out" identically as "app_separator". 

 

I found a workaround with the search in array of item tags and then use the previous Item Tag as "after item" to insert the new Item Tag in the same location where a deleted Item Tag was.

 

Any ideas:

  • whether there's a bug in that "item tags out" functionality? Or I understand this wrong?
  • about a better Item Tag replacement method?

(Attached is a vi example to play around with and the block diagram printscreens.)

 

Insert Menu Items Function - after item.png

 

Insert Menu Items Function - Search and I32 Index.png

0 Kudos
Message 1 of 4
(3,419 Views)

Probably i have to shorten it a bit:

 

Why are there no appending numbers on the app separator strings at the output "item tags out" of the Insert Menu Function, as the Labview Help suggests it?

0 Kudos
Message 2 of 4
(3,375 Views)

and here the front panel which shoes the item tags out indicators, all app separators without appended numbers...

 

Insert Menu Items Function - after item if app_separator - FP.png

0 Kudos
Message 3 of 4
(3,372 Views)

At the very least this is a discrepancy between the function help and the actual workings of the code.

 

It's clear that the help mentions making each tag unique by possibly modifying it, but I simply do NOT see this behaviour in LV 2012 or 2015.

0 Kudos
Message 4 of 4
(3,295 Views)