zero byte output after executing program
Posted: Wed Feb 03, 2021 12:11 am
This is a QuickBasic 1.1 and MS-DOS question
I created the following code and saved it as test.bas in the root of my C drive:
Then I created the following code as a new file:
as soon as I executed the new code, Qbasic reports test.out has a size of zero bytes. yet if I execute the same command in DOS as follows:
then the screen flickers blue for a brief second as if it is loading the Qbasic interpreter then it exits and when I check the \test.out file, it shows the expected output of:
Now the story is different if I compile test.bas into its own EXE (lets call it test.exe here and its stored in the root of the C drive). so if instead executed this code instead:
then the file length is reported correct.
Makes me think something funny is going on with the qbasic interpreter unless my DOSBOX is acting up.
Has anyone else experienced this issue? and how have you corrected it?
I created the following code and saved it as test.bas in the root of my C drive:
Code: Select all
print "TESTING 123 ABC"
system
Code: Select all
shell "\path\to\qbasic.exe /RUN \test.bas > \test.out"
open "\test.out" for binary as #1
print lof(1)
close #1
end
Code: Select all
\path\to\qbasic.exe /RUN \test.bas > \test.out
Code: Select all
TESTING 123 ABC
Code: Select all
shell "\test.exe > \test.out"
open "\test.out" for binary as #1
print lof(1)
close #1
end
Makes me think something funny is going on with the qbasic interpreter unless my DOSBOX is acting up.
Has anyone else experienced this issue? and how have you corrected it?