BBC BASIC for Windows
« Another bug in v 6.0? »

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



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: Another bug in v 6.0?  (Read 1019 times)
KenDown
Full Member
ImageImageImage


member is offline

Avatar




PM


Posts: 181
xx Re: Another bug in v 6.0?
« Reply #4 on: Jul 19th, 2015, 9:22pm »

Well, I did cut my teeth on a BBC model A until I could afford a B, so yes, I do omit spaces at every opportunity and actually find them an annoying distraction.

Anyway, thanks for finding the problem. Are there any other instances in which v.6 requires spaces? After all, the program compiles happily on v.5.95. If spaces are now required in certain circumstances, I think we should be alerted to them.

Thanks again.
User IP Logged

rtr2
Guest
xx Re: Another bug in v 6.0?
« Reply #5 on: Jul 19th, 2015, 10:44pm »

on Jul 19th, 2015, 9:22pm, KenDown wrote:
Are there any other instances in which v.6 requires spaces?

BBC BASIC has always required spaces in many situations, such as:

Code:
      IFcondition variable=number 

Obviously a space between "condition" and "variable" is essential here. However not all cases are as obvious:

Code:
      WAIT delay 

Here, by analogy with the IF example above, one might expect it to be acceptable to omit the space, but it isn't.

Because the rules governing when you must include a space, and when it's optional, are quite complicated the safest thing to do is always to include it - and it makes the program much more readable.

Quote:
After all, the program compiles happily on v.5.95.

The change comes about because of the introduction of 64-bit integer variables having a %% suffix. Previously, if the compiler encountered a percent sign it knew it must be the last character of the variable name, but that is no longer the case. So now it waits until it sees a character which definitely cannot be part of the name (for example a space).

The interpreter, on the other hand, has the luxury of parsing the program as it is executed at run-time, so a similar ambiguity doesn't arise.

Quote:
If spaces are now required in certain circumstances, I think we should be alerted to them.

I would turn this on its head: where have you seen in the BB4W documentation that spaces can be omitted? As far as I am aware nowhere does it say that, and you will be hard pressed to find any example programs which do so (except RHEOLISM!).

Few if any other dialects of BASIC allow you to omit spaces in the way you are doing, it's a quirk of BBC BASIC which was exploited in the BBC Micro days to squeeze more functionality in the limited memory, but it has always been discouraged. I would never do it myself, and I would venture to suggest that you are probably the only BB4W user who does.

It's a habit I would try to kick.

Richard.
« Last Edit: Jul 19th, 2015, 10:49pm by rtr2 » 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