Known QB64 Issues - QB64 Wiki

Known QB64 Issues

From QB64 Wiki

Jump to: navigation, search
Installation Failure

Qbasic decimal point value comparison errors
  • Floating decimal point numerical values may not be compared as exactly the same value.
Example: Qbasic will print unequal in the IF...THEN comparison code below even though it is exactly the same value printed.

x# = 5 / 10 y# = 6 / 10 z# = x# + y# PRINT x#, y#, z# IF x# + y# = z# THEN PRINT "equal" ELSE PRINT "unequal"

Note: QB64 will make the calculation correctly and print equal. Change older program code that relies on the error accordingly.

Compilation Failures
Qbasic allowed programs to append DATA to the end of BAS files because it separated the main code from sub-procedures.
  • IF...THEN statements cannot evaluate literal or variable STRING values as True or False without a comparison value. The QB64 IDE may not catch the coding error and it may not compile. IF statements can only evaluate numerical values as True(<> 0) or False(= 0).

Missed syntax Errors
  • Semicolons are NOT automatically added between PRINT variables or values. Add them manually if red lined.
  • Change Menu does not change all variable names when more than one is on a line. To be fixed after version 0.95 update.
  • Missing string end quotes or punctuation in code may not always be indicated in the status area.

Missed Compilation Errors
  • Will not report Subscript out of Range Error with DIM array when the variable has no value assigned. Qbasic reported at run-time.

Keyword Limitations
  • _BIT is not currently supported in User Defined TYPEs.
  • BYVAL cannot be used in CALL ABSOLUTE or other references. Can be used with the QB64 DECLARE LIBRARY definition.
  • COM port access with OUT or INP is not supported. OPEN COM IS SUPPORTED!
  • COMMON block names using /name/ are not currently supported.
  • ON TIMER(n) does not interrupt SLEEP.
  • OPEN cannot open an LPT port or devices such as CONS, SCRN, KBRD, etc. OPEN COM IS supported.
  • PLAY does not properly delay program progress yet and cannot be used for delays like Qbasic would. Use _DELAY if necessary. Now supports volume(V) and multiple simultaneous notes using comma separators!
  • SHELL: CD command does not change directory path. Use CHDIR. "CD" using _HIDE will return current path when sent to a file.
  • INTERRUPT (QB64 only supports INT 33h, functions 0 to 3)
  • CALL ABSOLUTE (QB64 only has support for PUSH/POP/MOV/RET/INT 33h, functions 0 to 3)
  • Port access ((QB64 only supports OUT &H3C7,&H3C8 and &H3C9 and INP &H3DA and &H60)
  • No Multi-modular support(RUN, CHAIN and COMMON are implemented)
  • No quick library(QLB) support. $INCLUDE text libraries using Qbasic and QB64 code are supported to re-use procedures.
After a program is compiled, the $INCLUDE files do not have to be included with the program.
Shell command problems
  • Use CHDIR instead of the CD command in SHELL to change directories. SHELL _HIDE "CD > " + file$ returns current path.
  • Use SHELL _HIDE to send screen data to a file using > piping. Screens will often not stay visible long enough to read.
  • Do not use SHELL "CMD /C "... without _HIDE as QB64 automatically adds CMD /C in Windows versions that can run QB64.

Printer problems
  • The CLEAR and RUN commands destroy the LPRINT image buffer, which is a bug in QB64.

Limited port register and memory address support
  • PEEK and POKE have very limited access to SCREEN and keyboard memory.

Eliminating QB64 temporary text files in Windows
  • When a QB64 program is run, two temporary files, STDOUT.TXT and STDERR.TXT, are generated. This may create problems when attempting to run a QB64 program on a CD or in a Read Only folder! To eliminate the generation of those temporary files, run the following program hack before compiling any new EXE programs. The program edits the QB64\INTERNAL\C\L\LIBMN.A file:
Not necessary for QB64 GL!

' THIS IS A QB64 HACK AND IS NOT SUPPORTED BY THE QB64 PROJECT. ' RUN THIS PROGRAM IN THE SAME DIRECTORY AS QB64.EXE IS LOCATED. DEFINT A-Z CLS PRINT PRINT "======================" PRINT "Patch libmn.a for QB64" PRINT "======================" PRINT PRINT "Loading file............"; OPEN "internal\c\l\libmn.a" FOR BINARY AS #1 IF LOF(1) = 0 THEN PRINT "Not found!" PRINT "Please run from within the QB64.EXE directory." CLOSE 1: KILL File$ END ELSE PRINT "OK!" END IF PRINT "Checking filesize......."; IF LOF(1) <> 207032 THEN PRINT "ABORTED: Invalid libmn.a filesize." CLOSE END ELSE PRINT "OK!" END IF PRINT "Continue with Patch? (Y/N)" DO HUH$ = UCASE$(INPUT$(1)) IF HUH$ ="N" THEN PRINT "Cancelled!": END END IF IF HUH$ = "Y" THEN EXIT DO LOOP Old$ = SPACE$(11) New$ = STRING$(11, CHR$(0)) GET #1, 204604, Old$ IF Old$ = "/stdout.txt" THEN PRINT "Patching 1st location..."; PUT #1, 204604, New$ PRINT "OK!" ELSE PRINT PRINT "ABORTED: Data not found, or the file's already patched." CLOSE END END IF GET #1, 204618, Old$ IF Old$ = "/stderr.txt" THEN PRINT "Patching 2nd location..."; PUT #1, 204618, New$ PRINT "OK!" ELSE PRINT PRINT "ABORTED: Data not found, or the file's already patched." CLOSE END END IF CLOSE PRINT PRINT "Done!" END

Code supplied by Dav
Compile and run the program in the QB64 folder. If the file is not found or not the same as the file specs the program will abort.

Report Compiler Bugs and missed Syntax Errors here!

See also:

Keywords currently not supported by QB64

Go to Keyword Reference - Alphabetical
Go to Keyword Reference - By usage
Go to Main WIKI Page
Personal tools