128 BASIC bug with report after immediate evaluation

The place for codemasters or beginners to talk about programming any language for the Spectrum.
Post Reply
equinox
Dynamite Dan
Posts: 1067
Joined: Mon Oct 08, 2018 1:57 am
Location: SE England

128 BASIC bug with report after immediate evaluation

Post by equinox »

I've just spotted a BASIC bug that I never noticed before.

In 128 BASIC, you can immediately evaluate a raw expression without the need for PRINT. For example, you can just enter 2+2 and receive the answer 4. (This is similar to the Calculator mode.)
It seems that the report line and statement numbers are not set properly in this case, but keep their old values. Try the following sequence after startup:

2+2
> report: 0 OK, 0:0
PRINT: PRINT
> report: 0 OK, 0:2
2+2
> report: 0 OK, 0:2

The same happens with non-OK reports, like error 6 when dividing by zero.
Is this a well-known bug? I've never seen it in any of the ROM bug lists. I don't think it's in
Nonowt's list, or in Ian Collier's +3 oddities.
Post Reply