Page 1 of 1

Adding line numbers to vintage BASIC code

Posted: Wed May 17, 2017 6:28 pm
by spintronic34
Hi,
I'm going through some old engineering problems that use vintage BASIC for their solutions (the kind where every statement needs a line number). I'm trying to work out a way to have TextPad automatically insert a line number for every statement in my code. Is this possible using search/replace and regular expressions? Or maybe there is a macro someone has made to do this? The code starts off without any line numbering at all.

Thanks for the help.

Posted: Wed May 17, 2017 8:09 pm
by MudGuard
replace ^ with \i{10,20,5,0}
probably it is a good idea to add a space after the } to have something between line number and rest of line.

First value in {} is start value, second is increment, third is width, fourth is fill character

Thank you!

Posted: Wed May 17, 2017 9:04 pm
by spintronic34
You're so smart! Thank you!