Print the "&" character

Just starting out? Need help? Post your questions and find answers here.
nessie
User
User
Posts: 60
Joined: Mon Jul 07, 2003 1:19 pm
Location: Glasgow / Scotland
Contact:

Print the "&" character

Post 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
User avatar
Shield
Addict
Addict
Posts: 1021
Joined: Fri Jan 21, 2011 8:25 am
Location: 'stralia!
Contact:

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

Post 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
Image
Blog: Why Does It Suck? (http://whydoesitsuck.com/)
"You can disagree with me as much as you want, but during this talk, by definition, anybody who disagrees is stupid and ugly."
- Linus Torvalds
User avatar
Rings
Moderator
Moderator
Posts: 1435
Joined: Sat Apr 26, 2003 1:11 am

Post 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.
SPAMINATOR NR.1
nessie
User
User
Posts: 60
Joined: Mon Jul 07, 2003 1:19 pm
Location: Glasgow / Scotland
Contact:

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

Post by nessie »

Thanks for the explanation and I've noted your advice on posting :) Thanks again
MachineCode
Addict
Addict
Posts: 1482
Joined: Tue Feb 22, 2011 1:16 pm

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

Post 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:
Microsoft Visual Basic only lasted 7 short years: 1991 to 1998.
PureBasic: Born in 1998 and still going strong to this very day!
Zach
Addict
Addict
Posts: 1675
Joined: Sun Dec 12, 2010 12:36 am
Location: Somewhere in the midwest
Contact:

Re: Print the "&" character

Post 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
MachineCode
Addict
Addict
Posts: 1482
Joined: Tue Feb 22, 2011 1:16 pm

Re: Print the "&" character

Post by MachineCode »

It was a joke, Zach. :)
Microsoft Visual Basic only lasted 7 short years: 1991 to 1998.
PureBasic: Born in 1998 and still going strong to this very day!
Zach
Addict
Addict
Posts: 1675
Joined: Sun Dec 12, 2010 12:36 am
Location: Somewhere in the midwest
Contact:

Re: Print the "&" character

Post by Zach »

I know but, I can't help it...

I'm a literalist
User avatar
kenmo
Addict
Addict
Posts: 2033
Joined: Tue Dec 23, 2003 3:54 am

Re: Print the "&" character

Post by kenmo »

This has been answered correctly above, but here is an official Microsoft explanation: http://support.microsoft.com/kb/261320

Just for reference.
Post Reply