Renumber to 10000 plus

Developer(s): Bob Mitchell
Date: 1989
Type: Program
Platform(s): TS 2068
Tags: Renumber

Renumbers a BASIC utility to line 10000 and up, in steps of five, so it can be MERGEd with any program without a clash of line numbers. A 31-byte machine-code routine, POKEd to 32000 from DATA by GO TO 1065, walks the program and rewrites each line number; lines above 9999 list with a colon as their first digit (:000 for 10000, ; for 11000 and so on). GO TO and GO SUB numbers are not changed, so set them by hand first, and lines numbered above 9999 cannot be edited afterwards.

Try it on itself: GO TO 1065, then RANDOMIZE USR 32000 and LIST. To start from another line, GO TO 1040 asks for the start line and POKEs it into the routine; as printed, line 1055 has POKE 3 2005,hi (with a space) where 32005 is meant, which stops with C Nonsense in BASIC. Line 1090 saves the utility with the Larken disk system (RANDOMIZE USR 100) and is not needed on tape.

Published in Sinc-Link January-February 1989 (Bob’s Notebook: Renumber to 10000+, TASWORD utils).

Related Articles

Let’s get back to some programming for a change. I have two interesting utilities from my notebook. 1.

Image Gallery

Source Code

1000 REM Renumber to 10000 plus
1005 REM Bob Mitchell 1988
1010 REM Do not leave out lines 1000 and 1005. Change them is OK
1015 CLS : PRINT "This utility allows renumbering to lines higher than the usual 9999."''"The current start line is set at 10000. Line numbers increment by five."
1020 PRINT '"To set a different start line use <GO TO 10040> now. Now, MERGE the program to be renumbered."
1025 PRINT '"DELETE the lines of this utility by using <DELETE 10000,10095>."
1030 PRINT '"Change all GO TOs etc manually calculating them carefully in respect to the new start line."''"When ready, use < RANDOMIZE USR 32000> to renumber."
1035 STOP
1040 INPUT "Start line # ? ",line
1045 LET line=line-5
1050 RANDOMIZE line
1055 LET hi=PEEK 23671: LET lo=PEEK 23670: POKE 32004,lo: POKE 3 2005,hi
1060 STOP
1065 RESTORE 1070: FOR i=32000 TO 32030: READ a: POKE i,a: NEXT i: GO TO 1015
1070 DATA 42,83,92,17,11,39,237,75
1075 DATA 75,92,167,237,66,200,9,6
1080 DATA 5,19,16,253,114,35,115,35
1085 DATA 78,35,70,9,35,24,231,0
1090 RANDOMIZE USR 100: SAVE "re#10+.B2" LINE 1065
1095 STOP

Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.