Skip to content

GW BASIC quirks and anomalous behaviour

Rob Hagemans edited this page Jul 3, 2022 · 1 revision

It's impossible to cleanly distinguish bugs from features in GW-BASIC. There is no formal language specification and the official documentation is often incorrect. BASIC programs have historically been developed experimentally, which means that many anomalies are relied on by some program or other to run correctly.

That said, some of these quirks are perhaps below the fold of what makes sense to target for replication in PC-BASIC. Note also that without further research it is not always clear if these are quirks in GW-BASIC or bugs in the emulation code used to run it.

The CONS: device

See https://robhagemans.github.io/pcbasic/doc/2.0/#devices

Running CONT after a break occurring in a subroutine called from the direct line

See https://robhagemans.github.io/pcbasic/doc/2.0/#CONT

Tandy row-25 anomaly

As seen on DOSBox 0.74.

Steps:

  • view print 1 to 25: key off:
  • Create a line continuing from row 24 to row 25
  • view print: key on:

The line still continues, it's now possible to move the cursor onto the key bar from row 24. But no continuation of the logical line if I press ENTER on row 24.

GW-BASIC row-24 anomaly

As seen on DOSBox 0.74.

Insert characters into existing text until the end of the text being inserted into hits the end of row 23. The text starts to overwrite although the cursor remains block-shaped. Then the inserted text continues on row 24 until the end of the row where no more text is inserted.

Also ESC in this case does not delete the whole line.

PC-BASIC keeps inserting until the end of the text hits the end of row 24, then stops.