News:

Welcome to RetroCoders Community

Main Menu

GW Basic LINENUM.BAS tool

Started by ron77, Nov 21, 2023, 06:02 AM

Previous topic - Next topic

ron77

10 REM PROGRAM TO ADD LINE NUMBERS TO FILES OF CODE WITHOUT LINE NUMBERS
20 FILENAME$="": OUTFILE$="": LINENUM$="": LINECOUNT=0
30 INPUT "ENTER FILENAME TO BE NUMBERED";FILENAME$
40 INPUT "ENTER OUTPUT FILENAME";OUTFILE$
50 OPEN "I",#1,FILENAME$
60 OPEN "O",#2,OUTFILE$
70 INPUT #1,LINENUM$
80 IF EOF(1) THEN 120
90 IF LEN(LINENUM$) > 0 THEN LINECOUNT=LINECOUNT+10: PRINT #2,LINECOUNT;LINENUM$
110 GOTO 70
120 CLOSE #1: CLOSE #2
130 END