Author |
Topic: Another bug in v 6.0? (Read 1016 times) |
|
KenDown
Full Member
member is offline


Posts: 181
|
 |
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.
|
|
Logged
|
|
|
|
rtr2
Guest
|
 |
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: 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 » |
Logged
|
|
|
|
|