From QB64 Wiki
IDE refers to the Integrated Development Environment or Editor used by QB64. Since the Editor is not an Interpreter, you cannot test code to see how it works without compiling it into an EXE file first! Pressing F5 will compile error free code and run the EXE file.
Errors may not be reported, but a compiler failure will be reported in the Status area! Errors that are reported after compilation may be due to missing program files! All program files MUST be placed in the QB64 folder to run the compiled code with the IDE!
Programs can be compiled WITHOUT the associated program files by pressing F11 or by compiling the code from the command line or a batch file. The command line to compile a program in the QB64 folder is: QB64 -c filename.BAS or QB64 -c %1 in a batch file.
QB64 COMPILER V1.1 USAGE: qb64 [switches] <inputs> OPTIONS: <file> Source file to load -c Compile instead of edit -x Compile instead of edit and output the result to the console -z Generate C code without compiling to executable -o <file> Write output executable to <file> -e Enables OPTION _EXPLICIT, making variable declaration mandatory (per-compilation; doesn't affect source file or global settings) -s[:switch=true/false] View/edit compiler settings
██ QB64 _ X
┌────────────────────────────────────█Untitled█─────────────────────────────────────────────┐ │DEFINT A-Z ↑ │DIM Array(100)_ █ │ ▒ │ ▒ │ ▒ │ ▒ │ ▒ │ ▒ │ ▒ │ ▒ │ ▒ │ ▒ │ ▒ │ ▒ │ ▒ │ ▒ │ ▒ │ ▒ │ ▒ │ ↓ ←█▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒→│ ────────────────────────────────────── Status ──────────────┤Find[ ↕]├─┤ │OK │ │ ↑ │ ▒ │ ▒ │ ↓
The 0.95 version update will involve downloading about 400 very small files (these are pre-cached help files) so it may take a few more minutes to complete but it is worth the wait. The files are used by the new integrated Help system menu available as of version 0.95.
- Recently opened files list in File Menu lists up to 4 previously used files. Click Recent for a list of more files.
- Bulk comment and uncomment. Click Comment in Edit Menu to comment or un-comment highlighted code lines.
- Quick movement between code bookmarks. Alt + Left arrow adds or removes a bookmark(slash in left border area).
- Quick Find search field at top of edit area. Click on ↕ arrow for a list of recently searched items.
- CONTROL + left/right arrow to move between words of text in your code.
- Double click text already in one line menu text entry fields to clear an item from the box area quickly.
- Copy (CTRL + C or CTRL + INS) and Paste (CTRL + V or SHIFT + INS) into single line menu text entry fields.
- Mouse wheel scrolls menu lists once a list or scroll bar is clicked on.
- Press alphabetical keys in the File menu list, SUB window list and others to jump through listed items.
- View/open/edit/save TEXT files with any extension, not just .BAS (you might like to use .BI for include files)
- Backward word searching using SHIFT + F3.
- Click on the ON LINE ## part of an error message box(now highlighted) to jump to that error location.
- HOME key now toggles between the absolute left hand side on the first press and the first indented character next press.
- The QB64 IDE may allow Alt + number pad character entries, but they must be inside of STRING values. Otherwise the IDE may not recognize them.
File Menu (Alt + F):
New Opens a new Editor screen. May prompt to save or Restore previous code. Open... Opens existing TEXT files. Displays list of BAS files when BAS only box is checked. Save Saves present code in the Editor as TEXT file. Prompts for new file name if "Untitled" Save As... Saves the present code as a new BAS file name if you choose to change it. ────────────────────────── ...ic\qb64\ScreenMode.bas List of up to four most recently edited files ...Basic\qb64\Console.bas Recent... Clicking on Recent opens a separate scroll list of all recently accessed files. ────────────────────────── Update SDL version only! Compiler updates no longer available. Manage updates in the Options Menu. ────────────────────────── Exit Exits the Editor. Any new code or changes will prompt the user to save them.
Edit Menu (Alt + E):
Cut Shift+Del or CTRL+X Cuts highlighted text and saves it to system Clipboard. Copy Ctrl+Ins or CTRL+C Copies highlighted text and saves it to system Clipboard. Paste Shift+Ins or CTRL+V Pastes contents of system Clipboard to last cursor position. Clear Del Clears all highlighted text from the Editor. Code is NOT saved! Select All CTRL+A Highlights all of the code text in the Editor. ──────────────────────────── Undo CTRL+Z Removes multiple code edits since previous undo or redo (V.94) Redo CTRL+Y Restores multiple undone code edits (V.94) ──────────────────────────── Comment (add ') Highlight code and click to block comment an area of code. Uncomment (remove ') Highlight code and click to uncomment an area of code. ──────────────────────────── New Sub... Creates a new Sub after the name is entered in the dialog box. New Function... Creates new Function after the name is entered in the dialog box.
View Menu (Alt + V):
Search Menu (Alt + S):
Find... Searches for highlighted words/text entered in the dialog box. Match Case or word. Repeat Last Find (Shift+) F3 Finds more instances of text in a program. Shift+F3 for Reverse. Change... Substitutes text for new text in the program using Find and Verify or Change All. ────────────────────────────── Add/Remove Bookmark ALT+Left Places or removes a - dash in the left editor border. Next Bookmark ALT+Down Moves editor code view down to next bookmark. Previous Bookmark ALT+Up Moves editor code view up to next bookmark. ────────────────────────────── Go to Line... Moves editor view to specified code line
Run Menu (Alt + R):
Start F5 Compiles into EXE file and runs program(with code whiteout). Modify Command$... ─────────────────────────── *Save EXE in the source folder available in GL versions since June, 2016 and 1.1 ─────────────────────────── Start (Detached) Ctrl+F5 Compiles into EXE and runs program separately (no code whiteout). Make EXE Only F11 Compiles into EXE without program files if there are no errors. ─────────────────────────── Make Android Project GL Compiled program as Android project(enabled in Options)
- If the code has just been created and was not saved in the IDE, the name of the compiled program will be "Untitled(n).exe"
Only the associated DLL files need to be included with the program EXE after it is compiled.
(The compiler can find Windows DLL files in the System folder and C++ DLL files in the QB64 folder.)
No additional program files need to be in the QB64 folder to Make EXE Only!The compiled EXE file can then be moved to a different folder holding the program files necessary when it is run.
Options Menu (Alt + O):
Display... Sets dimensions of Editor above 80 X 25 with specific Fonts and row heights. Language... Sets the extended language Unicode character Code Page to be used editing. Code Layout... Sets the Editor up for spacing, auto-caps of keywords, and code indentation. Update... SDL only! Updates are no longer available remotely online. Backup/Undo... Sets the Undo buffer limit from 10 to 2000 MB maximum(default 100 MB) ─────────────────────────── Advanced... GL advanced settings: Embed Debug Info, investigate crashes, etc. Swap Mouse Buttons GL swap of right and left mouse buttons. ─────────────────────────── Google Android... GL Android check box for Android option in Run menu and set batch path
Help Menu (Alt + H):
View Shift + F1 Returns to most recent Help page view Contents page Select Alphabetical, By Usage or FAQ Keyword index View keyword list by alphabetical name Keywords by Usage View keywords by usage ASCII chart Displays ASCII characters and ASC values. Math Solves numerical equations entered by user into box. ───────────────────── Update current page Updates only the current help page from WIKI Update all pages Updates all WIKI help information. This may take a while. ───────────────────── About... Displays the current version of QB64 being used.
- Note: Click in the Help window to scroll page info or click on blue links. Clicking the X or Escape exits Help Menu when active.
- Linked to WIKI. Update Help pages at least once a month to stay current.
- Cached for speed but updated on demand.
- F1 or Shift + F1 for help about a keyword (or symbol) the cursor is currently on in your code.
- F6 switches the active cursor between the Help screen and the code area alternately.
- Navigation ribbon for moving forward and backwards between recently viewed help pages.
- Typing a word quickly finds links on help pages (very useful on large index pages).
- Fully keyboard and/or mouse browsable.
- ASCII chart (and value of cursor's ASCII character shown).
QB64GL IDE Settings:
Text and keyword colors can be set in the QB64GL IDE by changing the _RGB color intensities in the following file:
85, 255, 255, 'Comment RGB Color 85, 255, 85, 'MetaCommand RGB Color 255, 255, 85, 'Quote RGB Color 255, 255, 255, 'Text RGB Color
OR change a few extra settings plus text and background colors if this file is present:
IDE_AndroidMenu = FALSE IDE_AndroidStartScript$ = "programs\android\start_android.bat" IDE_AndroidMakeScript$ = "programs\android\start_android.bat" '[GENERAL SETTINGS] DebugInfo = FALSE 'INTERNAL VARIABLE USE ONLY!! DO NOT MANUALLY CHANGE! BackupSize = 100 'in MB AllowIndependentSettings = FALSE '[IDE COLOR SETTINGS] TextColor = _RGB32(255,255,255) QuoteColor = _RGB32(255,255,85) MetaCommandColor = _RGB32(85,255,85) CommentColor = _RGB32(85,255,255) BackgroundColor = _RGB32(0,0,170) '[IDE DISPLAY SETTINGS] IDE_CodePage = 0 IDE_CustomFont = FALSE IDE_CustomFont$ = "c:\windows\fonts\lucon.ttf" IDE_CustomFontSize = 21 IDE_AutoFormat = TRUE IDE_AutoIndent = TRUE IDE_IndentSize = 4 IDE_Height = 48 IDE_Width = 136 IDE_AutoPosition = FALSE IDE_LeftPosition = 0 IDE_TopPosition = 0 '[MOUSE SETTINGS] SwapMouseButton = FALSE
Once the program EXE has been created, it can be moved to its own separate folder with the QB64 DLL files. It CANNOT run without those files! They must be included with any program package made available to other people or to be used on other computers.
Command Line and Batch Files:
No other program files besides the BAS file are required! 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 when it is run! 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.
- The batch file below can compile any BAS file from any location using drag and drop. The EXE will be created in the QB64 folder:
@ECHO OFF Set QB64=%~dp0 Echo. QB64 path: %QB64% CD "%QB64%" cmd /c start /low QB64.exe -c %1
- The batch file below will compile and move the EXE to the BAS file location when clicked on from the right click menu.
@Echo off Title QB64 Compiler color 5F REM BATCH file MUST be in the QB64 folder! Set QB64=%~dp0 Echo.QB64 Path: %QB64% REM Get filename only: Set FILE=%~nx1 Echo.BAS file: %FILE% REM Replace BAS with EXE: SET BASfile=%FILE% SET EXEfile=%BASfile:.BAS=.EXE% Echo.EXE file: %EXEfile% Echo. REM Get BAS file path: Set OLDIR=%CD% Set "OLDPATH=%OLDIR%\%EXEfile%" REM Change to the QB64 folder path: CD "%QB64%" REM Set QB64 folder path: Set "NEWPATH=%QB64%%EXEfile%" REM Display Paths: Echo.QB64 file: %NEWPATH% Echo.Move file: %OLDPATH% REM Compile BAS file: cmd /c start /low QB64.exe -c %1 REM Skip COPY if compiling BAS file in the QB64 folder: IF "%NEWPATH%" == "%OLDPATH%" GOTO END ELSE GOTO Check :Check IF EXIST "%NEWPATH%" (GOTO Finish) ELSE (PING 127.0.0.1 -w 1000 -n 3 >NUL) GOTO Check :Finish REM second ping below may be necessary for slow compilations. PING 127.0.0.1 -w 1000 -n 10 >NUL ECHO. MOVE /-Y "%NEWPATH%" "%OLDIR%" REM COPY "%NEWPATH%" "%OLDPATH%" /-Y ECHO. REM Pause GOTO END :END CLS
- Note: You can use COPY or MOVE to place the EXE file where the BAS file is located. Remove the /-Y parts for no prompt.
You can associate the batch file to the Right Click Popup Menu's Open With dialogue choices when you right click ANY BAS file:
- 1) Right click any BAS file and move to Open With and click Choose Program in the pop-up menu.
- 2) Your batch file will not be in the program choices so select Browse.
- 3) Navigate to the batch file in the QB64 folder and click on it.
- 4) Make sure that the Always use this program box is NOT checked! Then save your choice.
- Reference:70-????? = permission denied
- Something on your system is trying to access the files QB64 is using. Or maybe you are trying to run 2 copies of QB64 at once and something is going wrong.
How to Grant Permissions in Windows 7 1. Locate the file or folder on which you want to take ownership in Windows Explorer. 2. Right click on file or folder and select “Properties” from Context Menu. 3. Click on Edit button in Properties windows Click ok to confirm UAC elevation request. 4. Select user/group from permission windows or click add to add other user or group. 5. Under Permission section check the rights to grant or check “Full Control” under the “Allow” column to assign full access control permissions to the Administrators group. 6. Click OK for changes to take effect and click final OK to exit from Properties window. Now you can access files of folder in Windows 7 with full permissions and take full control.
Compiler Error Troubleshooting
- Immediately after seeing this message, go into the "qb64\internal\temp" folder of your QB64 installation and run the file recompile.bat (on Linux it is called recompile.sh, on MacOSX recompile.command).
- Report this output along with the .BAS code of the QB64 program causing the error.
- Note: 99% of the time a C++ COMPILATION FAILED message will be the result of invalid .BAS code which the QB64 IDE failed to identify and report before the C++ compilation process. Check for missed quotes and punctuation!
- Here's a recent example of QB64 code which causes this error:
IF a = 1 AND AND 2 THEN b = 2
- After reporting the problem (to be fixed properly!), try to fix (or workaround) the issue by locating the source of the error:
- Step 1: Look at the output from recompile.bat, it will probably mention a specific line within a file (the line usually ends up being within qb64/internal/temp/main.txt). Even though the file's extension may be '.txt' it contains C/C++ source code.
- Step 2: Locate the line within the main.txt file before compiling anything else.
- Step 3: Examine the line and its surrounding lines by looking at the names of variables (eg. '__SINGLE_A') and subs or functions (eg. 'func__loadimage'). Trying to figure out which part of your .BAS code the C code represents may involve some guess-work, but otherwise you will have to wait for a response if you report it to the forum!
- Step 4: Modify your .BAS code at that location (or code related to that location) until the error no longer occurs.
@echo off ECHO. ECHO Diagnosing Latest Compilation Error ECHO. ECHO Please wait... ECHO. cd .\internal\c .\bin\g -w -Wall -I.\i -I..\..\ -L.\l qbx.cpp libqbx.o -mwindows .\i686-w64-mingw32\lib\libimm32.a -lwinspool -lmingw32 -ln -lmix -limg -lttf -lmn -lSDL -s -o ..\..\ >..\..\0utput64.txt 2>&1 cd ..\.. ECHO. ECHO 0utput64.txt created! ECHO. PAUSE
Alternate IDE downloads: