Adding line numbers to vintage BASIC code

General questions about using TextPad

Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard

Post Reply
spintronic34
Posts: 7
Joined: Fri May 20, 2016 9:37 pm
Contact:

Adding line numbers to vintage BASIC code

Post 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.
User avatar
MudGuard
Posts: 1295
Joined: Sun Mar 02, 2003 10:15 pm
Location: Munich, Germany
Contact:

Post 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
spintronic34
Posts: 7
Joined: Fri May 20, 2016 9:37 pm
Contact:

Thank you!

Post by spintronic34 »

You're so smart! Thank you!
Post Reply