Page 1 of 1
A simple DCSAY queston
Posted: Wed Nov 17, 2010 1:12 pm
by BruceN
I have a customer whose name is Heads & Tails (don't ask my why - they sell UF, FSU, and Bucs gear, here in Tampa). Anyway, sometimes when their name is the value of a variable in a dcsay it shows as Heads_Tails. on a dcget it displays properly.
I assume xbase is translating the & as something else. How do I have it format right?
again thanks.
Re: A simple DCSAY queston
Posted: Wed Nov 17, 2010 1:45 pm
by rdonnay
The standard Windows convention is to use two & characters.
Your code should look like this:
Code: Select all
cName := Strtran(cName,'&','&&')
@ x,y DCSAY cName
Re: A simple DCSAY queston
Posted: Thu Nov 18, 2010 8:10 am
by BruceN
Curious... Attached is a sceen shot. In a browse the '&' shows properly, but not in a dcsay. Also, if I change the dcsay to a dcget, it displays properly. hmmm
Re: A simple DCSAY queston
Posted: Thu Nov 18, 2010 8:45 am
by bwolfsohn
Bruce,
I may be oversimplifying it, but i believe this only applies to dcsays, not dcgets, or browse items.. if the word seek had an & in it at the top of the browse, i suspect it too would be affected.
Re: A simple DCSAY queston
Posted: Thu Nov 18, 2010 11:09 am
by rdonnay
DCSAY objects are inherited from the XbpStatic class. These are basically the same as Labels in Windows. The & character follows this rule for menus and labels because the & character is used to underline the "hot key" of a label or menu item because it is a user prompt.
DCGETs and DCBROWSEs are displaying "data" not "prompts", therefore a different rule applies.
Re: A simple DCSAY queston
Posted: Thu Nov 18, 2010 11:16 am
by BruceN
I knew there had to be a reason for it... thanks.