Is there a way of saving the output when running a program in Qbasic?

369 Views Asked by At

Is there a way of saving the output when running a program in Qbasic?

The thing is, the program I run has a lot of output. I've already adjusted the screen size. While that can work sometimes, even that has its limitations with too much output. For some reason, I can't scroll the run screen up or down or anything.

Perhaps there is also a way to change the text size of output. But again, limitations here as well.

Therefore, is there a way to save the output to a file type like .txt, .nfo, etc. where I can read it in an easier to use format?

2

There are 2 best solutions below

1
On

Yes. Instead of printing to the screen, print to a file, with something like this:

OPEN “file.txt” FOR OUTPUT AS #1
FOR linenum = 0 TO numoflines -1
  PRINT #1, line$
NEXT linenum
CLOSE #1
END
0
On

Pl. do not confuse with "Line$" only, instead use, [variable1,Variable2...] etc. One can place some spacing formats like, Semicolon (;), comma(,); tab(n) or spc(n) command(s) for clarity and readability OR Locate Row,Column command for better printing.