A new renumber command that renumbers BBC BASIC program lines on a disc image, updating all line-number references to match.
Use case
Line renumbering is a classic BASIC maintenance task. Programs that have grown organically end up with gaps, crowded line numbers, or inconsistent spacing. The Acorn BASIC editor had a built-in RENUMBER command; beebtools should offer the same capability without needing to load the program in an emulator.
Proposed behaviour
beebtools renumber mydisc.ssd T.MYPROG
beebtools renumber mydisc.ssd T.MYPROG --start 100 --step 10
All GOTO, GOSUB, and RESTORE targets are updated to reflect the new line numbers. References to non-existent lines are preserved as-is with a warning.
Works on both DFS and ADFS images.
A new
renumbercommand that renumbers BBC BASIC program lines on a disc image, updating all line-number references to match.Use case
Line renumbering is a classic BASIC maintenance task. Programs that have grown organically end up with gaps, crowded line numbers, or inconsistent spacing. The Acorn BASIC editor had a built-in RENUMBER command; beebtools should offer the same capability without needing to load the program in an emulator.
Proposed behaviour
All GOTO, GOSUB, and RESTORE targets are updated to reflect the new line numbers. References to non-existent lines are preserved as-is with a warning.
Works on both DFS and ADFS images.