Watchers (not testers yet) needed.
EDIT (p.s.): WARNING: rn does NOT(!) renumber included line numbers in GO TO (GO SUB)!!! It's only for clean programs without GO TO and similar(!).
I finally have had found time, to improve my rn program (renumbering S[uper]BASIC-like programs). My test source "rnBefore_bas" (which will be renumbered) is:
Code: Select all
100 REMark Test for rn (renumbering C prog)
110 :
120 PRINT'hello world'
130 REMark Tests for rn: (Write in an Editor, not ED. Mix Lines with line numbers and without, with (forced) space after line number (not neessary, if you enter a line!).
140 :
AND HERE A LINE WITHOUT LINE NUMBER. WILL RN HANDLE THIS?
Now a line with a lower line number than the preceeding lines:
10 Oops, that's not possible in S(uper)BASIC (10 cannot follow after 140)
20 This line has spaces after the forced space. These MUST be preserved!
Of course only the spaces after the forced space, while for an unnumbered line
ALL spaces must be preserved.
999REMark (This was originally line 999): A line which cannot be saved but is correct SuperBASIC(!) In this case
REMark rn should (or should not, I'm not sure) add a forced space after the 999
5 REMark A linenumber with just one digit and forced space
8REMark and one 1 digit line number with missing forced space
1000:
1010 REMark: TODO: Add more tests above.
Code: Select all
10000 REMark Test for rn (renumbering C prog)
10005 :
10010 PRINT'hello world'
10015 REMark Tests for rn: (Write in an Editor, not ED. Mix Lines with line numbers and without, with (forced) space after line number (not neessary, if you enter a line!).
10020 :
10025 AND HERE A LINE WITHOUT LINE NUMBER. WILL RN HANDLE THIS?
10030 Now a line with a lower line number than the preceeding lines:
10035 Oops, that's not possible in S(uper)BASIC (10 cannot follow after 140)
10040 This line has spaces after the forced space. These MUST be preserved!
10045 Of course only the spaces after the forced space, while for an unnumbered line
10050 ALL spaces must be preserved.
10055 REMark (This was originally line 999): A line which cannot be saved but is correct SuperBASIC(!) In this case
10060 REMark rn should (or should not, I'm not sure) add a forced space after the 999
10065 REMark A linenumber with just one digit and forced space
10070 REMark and one 1 digit line number with missing forced space
10075 :
10080 REMark: TODO: Add more tests above.
Finally I realized, that I can use Visual Studio C (with its superb debugger :-) to develop rn further. The source now compiles with Visual Studio (free for private/small business usage) and EJC for the QL :-)))
Together with my reflection_cde it is now easily possible to merge any SuperBASIC-program. I hope I will find time, to publish an example here shortly (am currently extremly short of time).