Hacker News new | ask | show | jobs
by tromp 910 days ago
> If you ran out of numbers, the renum command would recompute all the line numbers for you.

This is the first time I heard of such a BASIC command, even though I grew up learning to program on a Sinclair ZX Spectrum.

Which of the home computers of the time had this command? Would it renumber in multiples of 10?

9 comments

To add to the multitude of existing comments: the C64 did not have it, but the C128 did.
RENUM was in GW-BASIC. So, any IBM "Compatible" had this for sure. It was also in Microsoft BASIC-80 so it would be in older machines as well.

The optional second argument would change the step size. The default was 10.

Amstrad CPC (Locomotive BASIC) and the BBC Micro both had it. In the CPC implementation, at least, you could choose the starting line number and the increment, e.g. RENUM 100,5
IIRC BBC BASIC let you choose the renumber increment, but the ZX Spectrum didn't.
For approved choices :)

> AUTO10,1000

Silly

> _

Wow I just tried this out on an Electron emulator. It seems like the second parameter for RENUMBER is limited to a byte (255).

The first parameter is weird, though: if you put in a number that's too large, the system reports a syntax error. 10000,255 works, but 50000,255 doesn't.

Isn't it because the line number is 16-bit unsigned int?
Great clue. Thanks!

RENUMBER takes maximum parameters of 32767 and 255.

But line numbers wrap! So if you do RENUMBER 32767,1 then your line numbers will go:

  32767
  0
  1
  2
  ...
Locomotive BASIC was also a very good BASIC implementation. I wrote a multiplayer game with background music in it, without having to resort to any PEEKs or POKEs like you would on a Commodore 64.
MSX supported that as well
Microsoft BASIC for Atari 400 and Atari 800 (which is distinct from the Atari BASIC that shipped with those computers) had a `RENUM` command that would renumber lines. New line numbers would start at 10 and increment by 10. Those defaults could be overridden.

https://archive.org/details/a8b_Atari_800_Basic_v1.0_1981_Mi...

Don't know which ones did. TRS-80, C-64, VIC-20, Atari 800, Apple II, did NOT
Don't know about other TRS-80 models but the Color Computer did have a RENUM command. It worked well as long as all of your GOTO and GOSUB statements jumped to existing line numbers. I learned quickly to at least stub out a REM line if I was going to add a jump to a sub-routine/code block that I hadn't written yet.
HC-BASIC, the common BASIC implementation on East German 8-bit computers (KC85/1../4, KC87, Z1013) has a RENUMBER command. Without args, it simply starts at the first existing line number and increments by 10. With args it was possible to move an existing range to a new starting line number and interval.
BASIC on the ZX was quite limiting, unless you were already enjoying 128K ZX Basic, or even better on CP/M for the +3A model with integrated floppy drive.
which BASIC for CP/M did you use? (there's a few, and there was no standard, so feature parity is not guaranteed)
CP/M already had compilers for BASIC, but I don't recall the name, I only owned a Timex 2068, the 128K were owned by other folks in our group.
I see. I think I've heard that Microsoft's BASIC was fairly popular, and I recently also downloaded BBC BASIC for CP/M - BBC BASIC is widely popular, but the only downside of its good documentation is that it doesn't say which version each thing is supported in.
Commodore Plus/4, C16/116 and C128 had it (BASIC V3.5 and up). COMAL on the C64 also had it.
TI-99/4A had it, but not sure if it was included in TI BASIC or only on TI EXTENDED BASIC.
Can confirm - it worked in both.