From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

BreakPoint

cancel
Showing results for 
Search instead for 
Did you mean: 

Insert menu item behaviour

I recently contacted NI support about a -bug report regarding the documentation of the function "Insert menu item".

 

It declares int he help that the values for "Item Name" is the string which appears in the menu and "Item Tag" is the unique Identifier for the menu item.  If only Tag is wired, the names are created automatically otherwise they take the values input on the terminal "Item Names".

 

I was a bit surprised when a bit of my code behaved differently than I had expected.  Apparently an empty string for "Item Name" is NOT created, even if I provide a perfectly valid "Item Tag".

 

I think this kind of thing needs to be mentioned in the help.  I don't want the behvaiour changed because it's actually a cool feature for what I'm doing but I can't reconstruct the real behaviour of the node from the help alone......  Nowhere is the difference in handling of an empty string as opposed to a non-empty string even mentioned.

 

Insert menu items help.png

 

Am I being too pedantic on this?

 

Shane

0 Kudos
Message 1 of 6
(8,907 Views)

Hello Shane,

 

Concerning the Empty String Item Name that doesn't get created.

 

Did you get in touch with an Applications Engineer about that?

Because at my side (in 2014) it does seem to get created. 

 

Or am I misunderstanding the test you are doing?

Kind Regards,
Thierry C - CLA, CTA - Senior R&D Engineer (Former Support Engineer) - National Instruments
If someone helped you, let them know. Mark as solved and/or give a kudo. 😉
Download All
0 Kudos
Message 2 of 6
(8,841 Views)

I was indeed in touch.

 

I was just told today that a CAR was opened, CAR 505080.

 

If it works in LV 2014 (which I haven't installed anywhere yet), then I suppose the idea of a CAR is kind of silly.

 

Shane

 

PS My problem was when dealing with the shurtcut menu of a control (run-time menus and so on).  In that example (where there is no menu bar as in your example) passing an empty string led to the item NOT being created.  A slight difference is also that I did provide valid item tags for all elements.

0 Kudos
Message 3 of 6
(8,838 Views)

Hey Intaris,

 

With the right-click shortcut menu I can indeed reproduce similar behaviour.


However, at  my side something else does also happen.

If you have x subsequent "empty string" item names, then it replaces those x subsequent "empty strings" by one separator.

 

I want to make sure this is the same behavior you are seeing.

Kind Regards,
Thierry C - CLA, CTA - Senior R&D Engineer (Former Support Engineer) - National Instruments
If someone helped you, let them know. Mark as solved and/or give a kudo. 😉
0 Kudos
Message 4 of 6
(8,828 Views)

Hmm, the seperator being added seems to be a new feature.  Did you also provide valid item Tags even for the entries which had empty item names?

 

On my tests (LV 2012 SP1), these items were thens imply not added, no separator, nothing. Trying to edit the items afterwards confirms that the items are not there (Error, items not found).

 

Shane.

0 Kudos
Message 5 of 6
(8,817 Views)

Hello Shane,

 

Yes, I did provide the item Tags.

Thanks for your feedback!

 

I just was asking some more questions out of personal interest. 🙂

 

 

Kind Regards,
Thierry C - CLA, CTA - Senior R&D Engineer (Former Support Engineer) - National Instruments
If someone helped you, let them know. Mark as solved and/or give a kudo. 😉
0 Kudos
Message 6 of 6
(8,757 Views)