[phpBB Debug] PHP Warning: in file [ROOT]/phpbb/db/driver/mysqli.php on line 264: mysqli_fetch_assoc(): Couldn't fetch mysqli_result
[phpBB Debug] PHP Warning: in file [ROOT]/phpbb/db/driver/mysqli.php on line 326: mysqli_free_result(): Couldn't fetch mysqli_result
Pete's QBASIC Site Discuss QBasic, Freebasic, QB64 and more 2021-02-22T19:06:08-05:00 http://petesqbsite.com/phpBB3/app.php/feed/topic/14858 2021-02-22T19:06:08-05:00 2021-02-22T19:06:08-05:00 http://petesqbsite.com/phpBB3/viewtopic.php?p=39063#p39063 <![CDATA[Re: zero byte output after executing program]]>
Tried the same exact thing in DOSbox here in QB1.0 and QB4.5 and it returned a LOF = 17.

TEST.BAS:

Code:

PRINT "TESTING 123 ABC"SYSTEM
TEST2.BAS:

Code:

CLSSHELL "qb /run test.bas > test.out"SHELL "type test.out"OPEN "test.out" FOR BINARY AS #1    PRINT "LOF ="; LOF(1)CLOSE #1END
Output:

Code:

TESTING 123 ABCLOF = 17
Also tried using absolute paths like you did and worked as well.

Statistics: Posted by Erik — Mon Feb 22, 2021 7:06 pm


]]>
2021-02-03T00:11:00-05:00 2021-02-03T00:11:00-05:00 http://petesqbsite.com/phpBB3/viewtopic.php?p=39048#p39048 <![CDATA[zero byte output after executing program]]>
I created the following code and saved it as test.bas in the root of my C drive:

Code:

print "TESTING 123 ABC"system
Then I created the following code as a new file:

Code:

shell "\path\to\qbasic.exe /RUN \test.bas > \test.out"open "\test.out" for binary as #1print lof(1)close #1end
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:

Code:

\path\to\qbasic.exe /RUN \test.bas > \test.out
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:

Code:

TESTING 123 ABC
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:

Code:

shell "\test.exe > \test.out"open "\test.out" for binary as #1print lof(1)close #1end
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?

Statistics: Posted by mikefromca — Wed Feb 03, 2021 12:11 am


]]>