This will not be about FORTH, but SuperBasic, Turbo and SSB etc.
When I want computation speed and low level capabilities, I don't compile SuperBasic nor assembler, I use C.
When I want interactivity (and speed) I use FORTH (on the QL, but on other engines I may use OBERON, JAVA or ComponentPascal).
When I want to play with the QL without hassle, I use SuperBasic which to my opinion was the best Basic interpreter in 1984, and still one of the most likeable up to day.
Concerning line numbers and some kind of C pre-processor looks, I was curious to read the SSB doc to see what it was about.
Quick and dirty, I wrote a 10 lines SuperBasic FuNction to add line numbers to Qed text edited files and have it LOADed or MERGEd as a plain SuperBasic program.
Code: Select all
1 DEFine FuNction add_line_numbers(f$,first,interval)
2 input_file$ = dev$ & f$ & "_txt"
3 output_file$ = dev$ & f$ & "_bas"
4 OPEN_IN#5,input_file$:OPEN_OVER#6,output_file$
5 I = first
6 REPeat number
7 INPUT#5,l$ : PRINT#6,IDEC$(l,5,0);" ";l$
8 IF EOF(#5) THEN EXIT number : ELSE l=l+interval
9 END REPeat number
10 CLOSE#6:CLOSE#5:RETurn l
11 END DEFine add_line_numbers
I found Mistakes in the joined PDF. I erased it to correct it and will put it back soon
Jedi is sorry ! here is a new pdf with corrections and additions :
Actually, I was caught in my own pitfall. As the manifest had statements (numbered outside proc. or Fncts.) which should be executed only once (like all the lresps.), I wanted to erase this part of code immediately after performing (with file TOOB). But merging this little file of commands had to be the first numbered statement outside any proc. or fn. At line 32741, it wasn't. So I just had to place it somewhere else (actually, at the end of CFORMS_txt).
Indeed, even when coding with SuperBasic without line numbers, you have ways to avoid using GOTO without requiring labels like with SSB.
Moreover, I did not find in the SSB doc any way to substitute for DATA RESTORE READ constructs without line numbers ? Which to my opinion are more useful than GOTO.
Bye, POLKa