Sqlite doesn't load & character

When I select name in Slqite db from table, the name has & sign in it ex. “FISH & GRILL” when I crate PopupMenu the name in list is “FISH GRILL” without &. Application is on ARM device. If I open Sqlite db in editor the name is OK “FISH & GRILL”.

customers = db.SQLSelect ("SELECT company_unit FROM customers") If db.Error Then Else If customers <> Nil Then PopupMenu2.DeleteAllRows While Not customers.EOF PopupMenu2.Addrow(customers.Field("company_unit").StringValue) customers.MoveNext Wend customers.Close End if PopupMenu2.ListIndex=0 db.Close End if End if

That’s not the database doing it, it’s the popupmenu. & is the menu accelerator character. It puts an underline under the character that follows it as a visual reminder that you can use that character with the accelerator key (eg., the control key) to perform an action. In the case of popupmenu, there is no accelerator key required and the action is to select that entry.

If you want to display an ampersand, you must escape it by using 2 ampersands. Ie., “FISH && GRILL” will display in the popupmenu as “FISH & GRILL”.

Xojo treats “&” as a special character when it comes to captions and menu items. On Windows (and Linux too, I think), menu items, buttons, etc., can have an “activator” character, i.e., a certain character in its name that will activate that item. This allows that OS to be entirely keyboard driven.

So, for example, if you specified a menu caption as “&Water Balloon”, it would show up on Windows without the “&” but with the “W” underlined. Likewise “W&ater Balloon” would underline the “a”.

The solution is compensate by replacing all your actual “&” with “&&” before inserting that caption into a menu.

Thank you for quick reply, I have replaced & with && it works now.
Is there any other special character treated that way in popupmenu?

I don’t think so, but check the LR. I’m sure this is described there.

Note that this is the OS, not Xojo.

Except Xojo fakes it (I think) on the Mac for consistency.