RenumQB

Anything QL Software or Programming Related.
Post Reply
User avatar
dilwyn
Mr QL
Posts: 3181
Joined: Wed Dec 01, 2010 10:39 pm

RenumQB

Post 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


User avatar
RalfR
QL Wafer Drive
Posts: 1264
Joined: Fri Jun 15, 2018 8:58 pm

Re: RenumQB

Post 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.


7000 4E75
User avatar
dilwyn
Mr QL
Posts: 3181
Joined: Wed Dec 01, 2010 10:39 pm

Re: RenumQB

Post by dilwyn »

Didn't think of this, Ralf, but thanks for letting us know.


Post Reply