BBC BASIC for Windows
« Why the Ampersand ? »

Welcome Guest. Please Login or Register.
Apr 5th, 2018, 11:20pm



ATTENTION MEMBERS: Conforums will be closing it doors and discontinuing its service on April 15, 2018.
Ad-Free has been deactivated. Outstanding Ad-Free credits will be reimbursed to respective payment methods.

If you require a dump of the post on your message board, please come to the support board and request it.


Thank you Conforums members.

BBC BASIC for Windows Resources
Online BBC BASIC for Windows documentation
BBC BASIC for Windows Beginners' Tutorial
BBC BASIC Home Page
BBC BASIC on Rosetta Code
BBC BASIC discussion group
BBC BASIC for Windows Programmers' Reference

« Previous Topic | Next Topic »
Pages: 1  Notify Send Topic Print
 thread  Author  Topic: Why the Ampersand ?  (Read 467 times)
kingsmiller
New Member
Image


member is offline

Avatar




PM

Gender: Male
Posts: 13
xx Why the Ampersand ?
« Thread started on: Mar 17th, 2014, 08:42am »


Below is a snippet from a BB4W Example program -

SYS "CreatePopupMenu" TO hsub%
SYS "AppendMenu", hsub%, 0, 0, "&Black"
SYS "AppendMenu", hsub%, 0, 15, "&White"
:
SYS "CreatePopupMenu" TO hpop1%
SYS "AppendMenu", hpop1%, 0, 1, "&Red"
SYS "AppendMenu", hpop1%, 0, 2, "&Green"
SYS "AppendMenu", hpop1%, 0, 4, "&Blue"
:

Why the Ampersand just before the colour name.

I am guessing it should have some visual effect but on my screen I cannot see any difference with or without the ampersand.

I have even seen E&xit (ampersand after the letter E) used, again I do not understand what it should do.

I would guess somewhere in the manual it does explain the reason - but so far I have not come across it.

Could someone throw some light on this subject as I may have forgotten its purpose.

Many Thanks
User IP Logged

rtr
Guest
xx Re: Why the Ampersand ?
« Reply #1 on: Mar 17th, 2014, 10:09am »

on Mar 17th, 2014, 08:42am, kingsmiller wrote:
I would guess somewhere in the manual it does explain the reason - but so far I have not come across it.

The manual's Search feature finds it. Open the Help viewer (e.g. press F1), click on the Search tab and in the 'Type in the keyword to find' box enter ampersand then click List topics.

The first hit in the results box is 'Adding a menu bar'; double-click on that and it will take you to the relevant section of the manual. There it says this: 'In each case one letter of the name is preceded by an ampersand (&): this determines the keyboard shortcut letter associated with the menu item'.

Quote:
I am guessing it should have some visual effect but on my screen I cannot see any difference with or without the ampersand.

Press the Alt key and all will be revealed! In Windows everything you can do with the mouse should have a keyboard equivalent. In the case of menu selections, that equivalent is to hold down the Alt key and press the key corresponding to the underlined character. Buttons in dialogue boxes have exactly the same feature, and the character is identified in the same way (a preceding ampersand).

Richard.
« Last Edit: Mar 17th, 2014, 10:13am by rtr » User IP Logged

kingsmiller
New Member
Image


member is offline

Avatar




PM

Gender: Male
Posts: 13
xx Re: Why the Ampersand ?
« Reply #2 on: Mar 17th, 2014, 10:32am »


Many Thanks for your reply.

For are quite right - I have searched the manual as suggested and its all explained quite clearly there.

Regards ..
User IP Logged

Pages: 1  Notify Send Topic Print
« Previous Topic | Next Topic »

| |

This forum powered for FREE by Conforums ©
Terms of Service | Privacy Policy | Conforums Support | Parental Controls