Page 1 of 1

Print the "&" character

Posted: Tue Nov 08, 2011 12:45 pm
by nessie
Sorry to post this but I'm having a bit of brain freeze. Trying to print some simple text to a window using a standard textgadget, but when I try and get it to display the & character it doesn't display it, just a space where it should be. Am I missing something or is it a bug?

Any help appreciated.

Thanks

Re: Help or is this a bug????

Posted: Tue Nov 08, 2011 12:47 pm
by Shield
You have to use && in order to display a single & because on Windows,
prefixing characters with an & means that they are meant to be shortcuts (which get underlined). :D

Posted: Tue Nov 08, 2011 12:52 pm
by Rings
@nessi:
Please use some more clearer readable topics
Rings wrote:Print the "&" character
instead of
nessie wrote:Re: Help or is this a bug????
thx,
i changed it already for now.

Re: Help or is this a bug????

Posted: Tue Nov 08, 2011 12:55 pm
by nessie
Thanks for the explanation and I've noted your advice on posting :) Thanks again

Re: Help or is this a bug????

Posted: Tue Nov 08, 2011 2:22 pm
by MachineCode
Shield wrote:prefixing characters with an & means that they are meant to be shortcuts (which get underlined)
So, how do we create a shortcut for the & character? ;) :lol:

Re: Print the "&" character

Posted: Tue Nov 08, 2011 2:46 pm
by Zach
My guess is you don't, because by its nature the ampersand (&) is a toggled character which requires a key combination to press.

I don't think you can make shortcuts for any keys on the system that require a Shift+Key combo and its probably why Microsoft chose to do it this way.

If you ever noticed in programs that let you define custom key macros, toggled characters will not show up, as they use the base key character instead.

i.e You can't make Ctrl+Shift+& because it would show up on the system as Ctrl+Shift+7 anyway

Re: Print the "&" character

Posted: Tue Nov 08, 2011 9:48 pm
by MachineCode
It was a joke, Zach. :)

Re: Print the "&" character

Posted: Tue Nov 08, 2011 11:27 pm
by Zach
I know but, I can't help it...

I'm a literalist

Re: Print the "&" character

Posted: Wed Nov 09, 2011 12:24 am
by kenmo
This has been answered correctly above, but here is an official Microsoft explanation: http://support.microsoft.com/kb/261320

Just for reference.