Page 1 of 1

RenumQB

Posted: Fri Sep 12, 2025 5:10 pm
by dilwyn
When I was porting the Dracula adventure to QL, to help with the process of converting programs from older PC BASICs to QL, I wrote a little utility called "RenumQB" to help with automating the renumbering of older programs, many of which seemed to be written in BASICs which had no RENUMber command.

Those listings may have had weird line numbering, or used 'labels' instead of line numbers, or even no line numbering at all.

And when a listing is full of randomly numbered GOTOs and GOSUBs, the code can be a right royal spaghetti which is hard to follow.

So, provided you've got a plain text listing of the program, RenumQB will make a list of lines, GOTOs and GOSUBs and try to sensibly and tidily renumber them for porting to QL, including replacing labels with line numbers (and inserting references to the original labels to help refer to the original listing), and correctly re-labelling GOTOs and GOSUBs (although it can't cope with computed GOTOs such as GOTO 5000*X).

Far from perfect, but I found it helped a lot when converting BASIC programs to QL.

Note: uses the QLiberator extensions Q_ERR_ON and Q_ERR_OFF. You may already have those extensions installed if you use the QLiberator compiler. If not, I've included a copy in the zip file (just LRESPR the Q_ERR_BIN file) along with an instructions DOC file and an example BASIC program to run through RenumQB.

Get it from https://dilwyn.theqlforum.com/basic/renumqb.zip

Re: RenumQB

Posted: Fri Sep 12, 2025 5:23 pm
by RalfR
The program has another benefit that has nothing to do with QL. It's great for editing lists and has sequential numbering, so you can use the numbers as a sorting index, so to speak.

Re: RenumQB

Posted: Fri Sep 12, 2025 6:32 pm
by dilwyn
Didn't think of this, Ralf, but thanks for letting us know.