QB64 FAQ

From QB64 Wiki

Jump to: navigation, search

This is a list of the most frequently asked questions and their current answers. The answers will be updated when necessary.

As with everything else, this list will be updated to correspond to new progress of QB64 so make sure that you are the latest version of QB64 (version 0.9 released 7/11/10). Please note that it may take a short time to update this list.

Contents

Q: What is QB64?

A: A Basic compatible compiler that creates working Executable files from Qbasic BAS files that can be run on the newer 64 bit PC's. The goal is to be 100% compatible with QuickBasic 4.5. The new keywords add some new features such as playing music or sound files and using 32 bit graphic file images. TCP/IP communication is also available.


QB is an abbreviation for QBasic or QuickBASIC which is a simple language that grew very popular in the 90's. It uses simple syntax but holds great potential as there are methods to achieve nearly anything. Qbasic is NOT DEAD YET thanks to QB64!

Q: Does it have modern features? Do they HAVE to be used?

A: QB64 has PLENTY of modern features, but they do not have to be used. You may just want to run some of your old favorites.

QB64 was created to run your old Qbasic programs on newer Operating Systems without ANY changes!

You could code using the original QuickBASIC syntax all the way through and it should work as you expect it to or even better. QB64 is often faster and has none of the memory limitations that plagued Qbasic in the past! Give it try! See for yourself.

For incompatibility issues you can look in the QB64 "Discussion" board here:


Visit the QB64 Community Forum


If your program(s) don't work correctly(check your code first) please feel free to post in the "Discussion" board.

Galleon is constantly working on pure compatibility. You don't have to set it up differently to use the modern features as they are made to work alongside original QB code seamlessly (unlike FreeBASIC and any other modern BASIC out there). The modern statements are designed to go along with the BASIC philosophy and expand Qbasic into the future!


QB64 FEATURES INCLUDE...

1) Full graphic functions for images up to 32 bit color. Custom window sizes. 2) Instant loading of image files including BMP, PNG, JPEG, GIF and more... 3) Supports sound files like WAV, OGG, MP3, speaker and volume control and more... 4) Animation is easy to do using _DISPLAY instead of page flipping. NO SCREEN FLICKER! 5) Clipboard support. 6) Networking over TCP/IP. 7) True type font support. 8) Integrated mouse input including wheel support.

Graphics Demo Download.


(Return to Table of Contents)

Q: Will it ever be 100% DOS compatible?

A: No, as this will require full DOS support to be emulated, however it will continually be updated to support more sourcecode and more features, memory addresses, ports, etc. so that it always approaches 100%. If you don't use too much POKE and OUT statements you probably won't notice any difference between QB 4.5 and QB64 (and if you do, report it as a bug in the forums, remember to check if the problem has been reported before though!), you can expect the most common addresses for POKE/OUT/interrupts, etc. to be functioning. Galleon has also received a comprehensive list of memory and port addresses so that even some less common addresses might work as well. If you are unsure, try!

(Return to Table of Contents)


Q: Can I use the same libraries with QB64 that I used with QB 4.5?

A: If the libraries are pure QB 4.5 code then yes, otherwise no, qlb files are not supported. The additional QB64 statements should make up for the use of libraries, however you can make libraries in QB64 that mimic the library you miss. There is currently work being done on a DirectQB library for QB64.


You can use $INCLUDE to use Qbasic BI files also!

Q: I can't get my QB 4.5 sourcecode to work in QB64! Why?

A: Perhaps that is because QB64 isn't 100% compatible yet, it is a work in progress. It is around 95-98% compatible right now, and that is a large number! As QB64 approaches the 1.0 version it approaches 100%. Look at the Unimplemented Qbasic Commands Forum for statements that are currently not available.


Q: I get the error "Common file missing! ******.***"

There are several DLL libraries that are required presently. The DATA folder in the QB64 folder MUST also be included!

Please see the Question below for more information! It has all of the required file information.


(Return to Table of Contents)

Q: What files are required to run my compiled program?

A: The QB64 compiler and EVERY EXE file created by the compiler are dependant on various DLL Library files to function properly. These files are found inside of the QB64 folder. This also explains why QB64 will create ALL EXE files in the QB64 folder no matter where the original BAS file is located on the computer. Your new program will require these files too, but you can move the DLL files to your shared SYSTEM32 folder to eliminate duplicates!


YOUR COMPILED EXE FILE NEEDS THESE QB64 DLL FILES TO RUN!


The list of library files you need to include with your program(s) as of July 2010:

jpeg.dll libfreetype-6.dll libgcc_s_sjlj-1.dll libogg-0.dll libpng12-0.dll libstdc++-6.dll libtiff-3.dll libvorbis-0.dll libvorbisfile-3.dll SDL.dll SDL_image.dll SDL_mixer.dll SDL_net.dll SDL_ttf.dll smpeg.dll zlib1.dll

The DATA folder and its contents ARE NO LONGER REQUIRED as of the 8/21/2010 version .91.!
Files inside of the older version DATA folder.

charset8.raw chrset16.raw qb64.pal qb64ega.pal qb64icon

It is suggested that frequent users copy the DLL files to the SYSTEM folder in Windows. The location should be:

C:\WINDOWS\SYSTEM32

This will allow all of your programs to run in any location without copies of the DLL files inside of every program folder. The DATA folder files are integrated into the compiler itself in version .91 only.

If you plan to make your program available for download, the DLL files listed above must be included.


A ZIP file with all of the required files can be downloaded here:

QB64 Program Package ZIP file.


The ZIP file can be used to unzip the DLL libraries into any program's folder location. It can also be used to create program download packages. Just create a folder with all of the relevant program files needed by your program and unzip the required QB64 files into it. Then you can ZIP the folder or all of the folder contents into your own zip program packages. We hope to have a package installer in the future.


This page and download will be updated when library additions or requirements change!

(Return to Table of Contents)

Q: My foreign keyboard has certain typing keys that do not work in QB64. Can I fix it?

A: Perhaps you can use the ASCII character codes. Go to the ASCII character chart and look for the character(s) you need. If you find them, remember the code number and use either CHR$(code%) or the Alt-number key method to type them into literal strings(real strings with quotes) only. The following QB64 program displays the characters on your PC:

SCREEN _NEWIMAGE(800, 600, 256) font$ = "C:\WINDOWS\Fonts\cour.ttf" 'TTF file in Windows style$ = "monospace" 'font style f& = _LOADFONT(font$, 22, style$) _FONT f& COLOR 11 FOR c% = 1 TO 6: PRINT c%; CHR$(c%);: NEXT FOR c% = 14 TO 27: PRINT c%; CHR$(c%);: NEXT FOR c% = 32 TO 255: PRINT c%; CHR$(c%);: NEX DO: SLEEP: LOOP UNTIL INKEY$ <> ""


The ALT Key Method: Hold the Alt key down and enter the code number using the Number Pad only. When you release the Alt key, the character should be in the IDE string you are making. Characters can be added (concatenated) using the + between the literal string and CHR$(code) or by using a semicolon as shown below:

PRINT CHR$(165) + "ormally I don't use these keys. Do You " + CHR$(168) 'concatenation PRINT CHR$(165); "ormally I don't use these keys. Do you"; CHR$(168) 'semicolons PRINT "Ñormally I don't use these keys. Do you¿" 'Alt-number pad method

Ñormally I don't use these keys. Do you¿

NOTE: You MUST use concatenation when defining a string variable using the CHR$ function character returns!
Link to the ASCII Character Table

To cut down on typing CHR$(???) all day, define often used characters as variables such as Q$ = CHR$(34) as shown below:

DIM Q AS STRING * 1 'define as one byte string(get rid of $ type suffix too) Q = CHR$(34) 'Q will now represent the elusive quotation mark in a string PRINT "This string uses "; Q; "quotation marks"; Q; " that might cause a syntax error!"

This string uses "quotation marks" that might cause a syntax error!


Warning! Do NOT use Notepad for special characters as it won't display them! It is best to enter them in the IDE.

You can use ANY of the ASCII characters to add borders, arrows, and many other characters not available on the keyboard. Hopefully this information will cure your problem!

(Return to Table of Contents)

Q: MUST I copy or drag ALL of my program files to the QB64 folder?

A: NO! But you will not be able to compile or run it using the editor either. The editor requires that the files associated with your program be available when the program starts AFTER the EXE has been created! You can compile your program without using the editor however. It will require you to do a few extra things:

1) Use a batch file or a command line as follows: QB64 -c yourfile.BAS 2) Move the compiled EXE file back to the folder with the program files. 3) Copy ALL of the QB64 DLL files from the QB64 folder to your new program's folder. 4) Try the EXE file to see how it works.

A download is available that can make transferring the required library files easily. Just unzip to any folder!

QB64 Program Package ZIP file.


The Answer to the Question below will show you how to create a batch file and compile BAS files from ANY location.

(Return to Table of Contents)

Q: Is there a way to use the compiler without running my program or using the IDE?

A: Yes! Use the following command to compile a program without running it:

QB64 -c yourfile.BAS

One advantage to compiling without running a program is that the QB64 editor will require that ALL of the necessary program files be placed inside of the QB64 folder or errors will occur! Also the EXE file will not be made or will disappear as it is no longer a valid application! To run the newly created EXE file, MOVE IT BACK to the location where your other program files reside.

NOTE: You must also copy the QB64 DLL libraries to the new program's folder location!


The batch file below can compile any BAS file from any location using drag and drop. The EXE will be in the QB64 folder:

@ECHO OFF CD C:\'Path to your QB64 folder cmd /c start /low QB64.exe -c %1

You will be able to drag and drop BAS files onto the batchfile or you can associate the batch file to the Right Click Popup Menu's Open With dialogue choices when you right click a BAS file. To do that, just right click any bas file and move to Open With and click Choose Program. Your batch file will not be in the program choices so select Browse. Find the batch file location (it should be in QB64 folder) and click on it. Make sure that the Always use this program box is NOT checked! Then save your choice.

(Return to Table of Contents)

Q: Previous version of QB64 worked, but later version don't, why?

A: Sometimes when correcting bugs/adding new features/adding compatibility things are changed in a way that can make new versions fail on certain systems, this is obviously something that Galleon is working to avoid. Post your problem on the forums if it hasn't been posted before, remember to post information about your specific system (as it is probably not a general problem), Galleon is known to often reply himself to such problems and you get the best information available on when it will be fixed and why the problem arise. If Galleon is busy you can expect other users to respond as well.


Q: CHAIN doesn't work the way I'm used to...

A: CHAIN has been implemented in QB64 versions 0.851 up. Be sure to download the latest version of the compiler when available.

Note: QB64 will automatically compile the named BAS file if it does not find the EXE file.

The statement also can use COMMON or COMMON SHARED to pass program information. However QB64 uses files to pass the information. If your program moves to a location other than the EXE file's location, the file may be inaccessable! To avoid this problem, make sure that your program can refer to that location using a path.


There are minor differences from QBasic in that it doesn't open a program in the same window and does not retain the previous screen mode or format. This problem will be addressed in future releases!

(Return to Table of Contents)

Q: Some screens look small. Can I enlarge them or make them fullscreen?

You can use the _FULLSCREEN statement to make your programs run fullscreen.


You can also create custom sized screens with page flipping and up to 32 bit colors using _NEWIMAGE.


Page flipping is available in most screens and the new _DISPLAY feature allows the images to be displayed when YOU desire.


Picture or image files such as BMP, PNG, JPEG and GIF are EASY to load using _LOADIMAGE.


Once images are loaded, all you have to do is use the image handle with any of the new statements and functions.


_PUTIMAGE GETs and PUTs images fast in ONE call. It can even stretch or compress the image sizes!


Graphics Demo Download.


(Return to Table of Contents)

Q: Do SOUND, PLAY and BEEP work?

A: Yes, they are emulated to use the soundcard instead of the old boring monotone PC-speaker that is rapidly disappearing.

There also are a bunch of new sound capabilities that allow the use of WAV, OGG, MP3 files and more.

Capabilities include:

  • 1) Multiple sound tracks
  • 2) Volume and speaker control
  • 3) Background music
SOUND HAS RETURNED TO QBASIC!


Get started with SOUND NOW!

Q: The IDE isn't always working as I would expect...

A: The IDE is currently being worked on, but it has a lower priority than the compiler (for obvious reasons), syntax checking isn't always working as you would expect, etc., Galleon knows about these issues and makes effort to resolve them in due time. The compiler is priority number one though (and the IDE is useable as it is, after all). Galleon has said that he is planning on making a key-map for the IDE, so that it will support any keyboard. Currently some keyboard layouts aren't functioning as expected (as they did on QB 4.5).

(Return to Table of Contents)


Q: The IDE looks old! DOSish...

A: It is only a skin, the IDE can be made to look like a modern IDE, Galleon decided to make it look like QB 4.5, you can expect modern looking IDEs to be available in the future. As of version (0.86) the ability to select fonts and changing the window size of the IDE has been added, this should improve the experience quite a bit!


Q: The autoformatting doesn't work correctly in the IDE...

A: The autoformatting only has minor bugs which doesn't (what we know about) alter the actual execution of the code in any way, for now if you save your code in the current formatting it will format correctly in later versions of QB64. If the code you have is 'corrupted' by autoformatting, then please report it on the forums, cause that would be a serious issue, if you can you should also provide code example of how it was corrupted.

(Return to Table of Contents)


Q: Does it work on Windows 98? or any older than Windows 2000?

A: No, not yet, it is a low-priority issue, since QB64 is made to run on new systems (WinXP -> Vista etc.), Galleon has said that he wants to make it work on Windows 98 too, so if you are patient it will eventually work there as well. It should work on NT/XP/2000 though. The .exe files produced by QB64 does work in Windows 98 though, as long as the libraries are supported on that system.


Q: What about Linux?

A: Linux is supported, but Windows is a higher priority as it has more users. The demand for Linux versions are high enough for Galleon to produce them regularly though. 64 bit Linux support has been implemented as of July 2010. We would appreciate your feedback!

(Return to Table of Contents)

Q: Will it ever work in DOS?

A: Perhaps, but don't count on it, it is a massive undertaking to make it work on DOS as it is a 32-bit/64-bit program. Galleon understands that the new features would be nice to have on DOS but this does not justify the work that would need to be done.


There are QB 4.5 techniques on high resolution graphics and playing soundfiles etc., go to qb45.com and look at Downloads and Future Software, you can download the library fl35.zip which is the future.library, it has high resolution graphics similiar to that of QB64, also check out fl35add.zip for bugfixes and additions to the library.

Q: What are the specifications?

A: Since this is a relatively new product in the making, it hasn't been tested as thoroughly as to have defined specifications. However, if you have a relatively new computer you will probably be fine. If you have a old computer then try anyway and let us know if it works!

(Return to Table of Contents)


Q: Does a licence come along with QB64?

A: Yes, as of version 0.85 a licence comes along with it and it is released as freeware. Read the licence.txt that comes along with the package for more information. QB64 will always be free to use with the current library files and the licenses DO NOT limit the use of those libraries!

Q: How can I find what caused a Compiler error?

A: Compiler errors are often actually coding errors that both you and the IDE don't notice! Often it is a syntax error such as forgetting a quotation mark in a PRINT. Look for syntax errors too as the IDE still needs some improvements. The best way to get a clue to the problem is to run the following batch file IMMEDIATELY AFTER a compilation failure:

@echo off ECHO. ECHO Diagnosing Latest Compilation Error ECHO. ECHO Please wait... ECHO. cd .\internal\c .\bin\g -w -Wall -I.\i -L.\l qbx.cpp -mwindows -lwinspool -lmingw32 -lq -ln -lmix -limg -lttf -lmn -lSDL -o ..\..\test.exe cd ..\.. ECHO. ECHO. PAUSE

Note: Make sure that test.exe is at the end of the long code line when copying!

Look for the word error in the resulting information window. The errors often have to do with syntax or code errors you made.

To make the batch file, copy the above code to a new Notepad text file and Save As ALL FILES with a name and BAT file extension.

(Return to Table of Contents)

Q: Where can I find information about a QB64 statement or function?

The keyword lists can be found at the following locations:

<center>Navigation:
Go to Keyword Reference - Alphabetical
Go to Keyword Reference - By usage
</center>


Offline Download:

Download the QB64 WIKI for Offline Reference!.

Personal tools