IDE

From QB64 Wiki

Revision as of 17:12, 13 October 2011 by Clippy (Talk | contribs)
(diff) ← Older revision | Current revision (diff) | Newer revision → (diff)
Jump to: navigation, search

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 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.

Editor

Alt + Enter will make the Editor full screen or alternately reduce it back to a window.

██ QB64 _ X

 File   Edit   View   Search   Run   Options

┌───────────────────────────────────────────────────────────────────────────────────────────┐ │DEFINT A-Z █ │DIM Array(100)_ │ ▒ │ ▒ │ ▒ │ ▒ │ ▒ │ ▒ │ ▒ │ ▒ │ ▒ │ ▒ │ ▒ │ ▒ │ ▒ │ ▒ │ ▒ │ ▒ │ ▒ │ █ █▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒█│ ────────────────────────────────────── Status ──────────────────────────────────────────────┤ │OK │ │ █ │ ▒ │ ▒ │ █

2:15

The Status area displays the current status of code entries. The cursor location is displayed as the row:column in the aqua bar.

File Menu (Alt + F):

  • New: Opens a new Editor screen. May prompt to save previous code.
  • Open: Opens an existing file. Displays a list of existing BAS files.
  • Save: Saves the present code in the Editor as a BAS file. Will prompt for a new file name if presently named "Untitled"
  • Save As: Saves the present code as a new BAS file name if you choose to change the present name.
──────────────────────────
  • Update: Checks to see if a QB64 compiler update is available. If no update is available it will say so. Allow updates to complete before using the Compiler or Editor! Use the Options Menu to turn off or set up Automatic QB64 Updates.
──────────────────────────
  • Exit: Exits the Editor. Any new code text or changes will prompt the user to save them.

Edit Menu (Alt + E):

  • Cut (Ctrl + X): Cuts highlighted text from the Editor and saves it to the system Clipboard.
  • Copy (Ctrl + C): Copies highlighted text from the Editor and saves it to the system Clipboard.
  • Paste (Ctrl + V): Pastes the contents of the system Clipboard to the Editor in the last cursor position.
  • Clear (Del): Clears all highlighted text from the Editor. Use carefully as it 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)
──────────────────────────
  • New Sub...: Creates a new Sub procedure after a name is entered in the dialog box.
  • New Function: Creates a new Function procedure after a name is entered in the dialog box.
WARNING: Hitting a key on the keyboard may remove all of the highlighted code! Save OFTEN!


Back to Top

View Menu (Alt + V):

  • Subs... (F2): Opens a list of the module and Sub and Function procedure names that can be viewed individually.


Search Menu (Alt + S):

  • Find: Searches for a highlighted word or text entered in the dialog box. Options to match Upper or Lower Case or Whole word.
  • Repeat Last Find (F3): Can continue to find more instances of the word throughout a program. Use F3 without the menu.
  • Change...: Allows a code word to be substituted for any specified word throughout the program.
  • Go to Line...: Moves editor view to specified code line

Run Menu (Alt + R):

  • Start (F5): Compiles and immediately runs the code in the Editor. Unsaved code may be compiled as "Untitled(n).exe".
──────────────────────────
  • Start (Detached) (Ctrl + F5): Compiles the code in the Editor and runs the program separately. Prevents IDE whiteout!
  • Make EXE Only (F11): Compiles the code in the Editor to the saved name as an EXE file if there are no errors.
Text code $INCLUDE files, DLL files and C++ Library .h header files must be in the QB64 folder.


NOTE: No additional program files need to be in the QB64 folder to Make EXE Only!

Options Menu (Alt + O):

  • Display...: Allows the dimensions of the Editor to be increased above 80 X 25 with a certain Font and row height.
  • Language...: Sets the extended language character Code Page to be used when printing characters.
  • Code Layout...: Sets the Editor up for spacing, auto-capitalization of keywords, and code indentation.
  • Update...: Sets the Auto-Update preferences of the user. Can turn all updates off.
  • Backup/Undo...: Sets the Undo buffer limit from 10 to 2000 MB maximum(default 100)
──────────────────────────
  • About...: Displays the current version of QB64 running.


Back to Top

QB64 Requirements:

Compiled EXE Programs Require DLL Files to run!

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.


Download QB64 DLL files in a Zip File


The Zip file above can be used to unzip the required DLL files into any program folder or download package necessary.


  • WARNING! Do not place DATA fields after SUB or FUNCTION procedures! QB64 will FAIL to compile properly!
Qbasic allowed programmers to add DATA fields anywhere because the IDE separated the main code from other procedures.
Back to Top

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.

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 created in the QB64 folder:

@ECHO OFF Set QB64=%~dp0 Echo. QB64 path: %QB64% CD "%QB64%" cmd /c start /low QB64.exe -c %1

Place the BAT file in the QB64 folder! You will also be able to drag and drop BAS files onto the batchfile.


Download the QB64 Editor and Compiler Shortcuts and Compile Error Batch Files


Associating the batch file in the Right Click Open With pop-up menu

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.
The compiled EXE file can be found in the QB64 folder!


WARNING! You may need Administrator rights to install or use QB64!
Back to Top

References:

See also:

  • PSPAD Windows alternative editor
  • GEDIT Linux alternative editor


Known QB64 Issues


Report Compiler Bugs here!


Report missed Syntax Errors here!



Navigation:
Go to Keyword Reference - Alphabetical
Go to Keyword Reference - By usage
Go to Main WIKI Page