& in a popupmenu

I am having a little difficulty which I am sure is simple but I cannot resolve.

I populate a popupmenu similar to this:

tMyTitle = "Terry & Linda" PopupMenu1.DeleteAllRows PopupMenu1.AddRow("All") PopupMenu1.AddRow("none") PopupMenu1.AddRow("-") PopupMenu1.AddRow(tMyTitle)

When I try to use the popupmenu “Terry & Linda” displays as “Terry Linda”.

Where has my & gone and how do I get it back please?

Mac OSX 10.9.2

All the best

“Terry & Linda”

use double “&&”

That’s called “escaping”. & is used as a control character, so to escape its control character role and be just a normal char you double it.

Thank you both.

I am aware of escaping.

Where would I find the definitive list of characters that need escaping in a popupmenu.

I presume this also applies to the Main Menu Bar and Contextual Menus.

I am familiar with Xcode/Objective C and have not had a need to escape “&” in Cocoa menuItems.

I thought Xojo was now cocoa? or is this a Windows thing?

All the best


Windows Thing

My assumption (as Karen mentioned) that it is due to how Windows handles menus (because Xojo is xplat)

In a Windows Menu if you have “&x” it will display as underlined (ie. a Hotkey)