BBC BASIC for Windows
IDE and Compiler >> Program Editor >> Colour v color
http://bb4w.conforums.com/index.cgi?board=editor&action=display&num=1381101634

Colour v color
Post by Michael Hutton on Oct 22nd, 2008, 07:01am

A style option for the spelling of the word COLOUR in the IDE for our cousins over the pond?

Michael
Re: Colour v color
Post by admin on Oct 22nd, 2008, 09:37am

Quote:
A style option for the spelling of the word COLOUR in the IDE for our cousins over the pond?

As you may have noticed, COLOR is accepted, but it is immediately changed to COLOUR on hitting Enter! BBC BASIC is very much a British product so I feel that is an adequate concession to our transatlantic cousins!

There are in any case practical difficulties with your suggestion, because even if the IDE had such a configuration option how would the interpreter know what spelling to use in *LIST (e.g. in a compiled executable)?

Richard.

Re: Colour v color
Post by DDRM on Oct 22nd, 2008, 1:39pm

on Oct 22nd, 2008, 09:37am, Richard Russell wrote:
even if the IDE had such a configuration option how would the interpreter know what spelling to use in *LIST (e.g. in a compiled executable)?


Hi Richard,

Presumably by using the option to decide how to "decode" the relevant token? Is that not how the IDE changes it from COLOR to COLOUR? I assumed the parser recognised it as an alternative form of the keyword, and put in the relevant token, but then expressed it back again - as "P." is converted to PRINT, and so on. Thus it would simply be a case of setting it to show the US version whenever it comes across that token.

Of course, if that's not how it works, it may not be so simple (if doing what I suggest IS simple, when it comes to the code under the bonnet!)....

... not that I necessarily think it's good to pander to the linguistic preferences of our overseas colleagues...

smiley

D


Re: Colour v color
Post by admin on Oct 22nd, 2008, 2:12pm

Quote:
Presumably by using the option to decide how to "decode" the relevant token?

My point was that a BASIC program being executed by the interpreter knows nothing about the IDE or its settings. The program might be run using BBCWRUN.EXE or as a 'compiled' executable; in neither case is the IDE necessarily loaded (or even installed) so there's no "option" for the program to refer to.

Even if one contrived a means for the interpreter to access the IDE's settings, I can't see much point in a program *LISTing the token as COLOR when running under control of the IDE, but reverting to COLOUR as soon as it is run independently of the IDE.