4 ms·
> 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 thou
by tromp 3y 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?
- Doctor_Fegg 3y agoAmstrad 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
- rahimnathwani 3y agoIIRC BBC BASIC let you choose the renumber increment, but the ZX Spectrum didn't.
- Baldbvrhunter 3y agoFor approved choices :) > AUTO10,1000 Silly > _
- rahimnathwani 3y agoWow 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.
- ikari_pl 3y agoIsn't it because the line number is 16-bit unsigned int?
- rahimnathwani 3y agoGreat 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 ...
- ikari_pl 3y agoThis is even more interesting, 32767 is the max signed 16-bit int. And it wouldn't wrap to 0 after that for sure. Btw does it allow 0? Amstrad's BASIC does not (oficially).
- rahimnathwani 3y agoI no longer have an Acorn Electron, but using ElkJS (https://elkjs.azurewebsites.net/ https://elkjs.azurewebsites.net/) I did: >0 REM >10 REM >RENUMBER 32767,1 >LIST 32767 REM 0 REM >0 REM >LIST 0 REM 32767 REM 0 REM
- rahimnathwani 3y agoI asked a friend to test this on a real Acorn Electron. It behaved the same. He also found some more info from the web and by trying stuff out: Hey, I confirmed this is the same on the actual machine so yep it looks like this was part of the ROM. I found a small amount of info, including that the maximum actual line number is 65279 (BBC BASIC V file format — Matt Godbolt’s blog (xania.org). It looks like the BASIC editor only properly dealt with lines up to 32767 (0x7FFF), including ANDing them with that when using LIST! Weird things happen if you have a program with line numbers beyond 32767. LIST shows the wrong line numbers, RENUMBER doesn't renumber GOTOs properly.
- eterps 3y agoMSX supported that as well
- gsliepen 3y agoLocomotive 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.
- deleted 3y ago[deleted]
- nox100 3y agoDon't know which ones did. TRS-80, C-64, VIC-20, Atari 800, Apple II, did NOT
- Mountain_Skies 3y agoDon'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.
- deleted 3y ago[deleted]
- pjmlp 3y agoBASIC 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.
- ikari_pl 3y agowhich BASIC for CP/M did you use? (there's a few, and there was no standard, so feature parity is not guaranteed)
- pjmlp 3y agoCP/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.
- ikari_pl 3y agoI 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.
- rented_mule 3y agoMicrosoft 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_Microsoft https://archive.org/details/a8b_Atari_800_Basic_v1.0_1981_Mi...
- flohofwoe 3y agoHC-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.
- layer8 3y agoCommodore Plus/4, C16/116 and C128 had it (BASIC V3.5 and up). COMAL on the C64 also had it.
- wsc981 3y agoTI-99/4A had it, but not sure if it was included in TI BASIC or only on TI EXTENDED BASIC.
- indymike 3y agoCan confirm - it worked in both.
- ok123456 3y agoRENUM 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.
- Timwi 3y agoTo add to the multitude of existing comments: the C64 did not have it, but the C128 did.