Encyclopedia  |   World Factbook  |   World Flags  |   Reference Tables  |   List of Lists     
   Academic Disciplines  |   Historical Timeline  |   Themed Timelines  |   Biographies  |   How-Tos     
Sponsor by The Tattoo Collection
QBasic programming language
Main Page | See live article | Alphabetical index

QBasic programming language

QBasic (Quick Beginner's All-Purpose Symbolic Instruction Code) is a variant of the BASIC programming language. It is not capable of compiling standalone executables. The source code is compiled to an intermediate form within the integrated development environment, and this intermediate form is immediately executed (interpreted) on demand within the IDE. It was intended as a replacement for GWBASIC, and was shipped together with MS-DOS 5.0 and higher, including Windows 95. It was based on the earlier QuickBASIC 4.5 compiler but without QuickBASIC's compiler and linker elements.

Microsoft stopped shipping QBasic with later versions of Windows. Windows 98 users, however, will find it in the \\TOOLS\\OLDMSDOS directory of the CD-ROM; on the Windows 95 CD-ROM, it is in the \\OTHER\\OLDMSDOS directory. It is now only available from Microsoft's website for licensed users of MS-DOS. QBasic provided a state-of-the-art IDE (for its time), including a debugger with features such as on-the-fly expression evaluation and code modification that were still relatively unusual in 2003, more than ten years later.

QBasic was also the subject of several programming books for beginners.

QBasic came complete with a couple of pre-written example games. These were Nibbles (a variant of the Snake game found on most Nokia cellphones) and Gorillas, an explosive-banana throwing game.

Table of contents
1 Syntax
2 Code Example (displays "Hello, World")
3 Special Keys
4 External links

Syntax

Like QuickBASIC, but unlike earlier versions of Microsoft BASIC, QBasic was a structured programming language, supporting constructs such as named subroutines and while loops. Line numbers, a concept often associated with BASIC, were supported for compatibility, but were not necessary and not considered good form. QBasic also has support for user-defined data types (structures).

Code Example (displays "Hello, World")

PRINT "Hello, World"

Special Keys

Press Ctrl+Pause to break a running program.
Press F5 to continue a program whose execution was broken.
Press Shift+F5 to restart a program back from the beginning.
Press F4 while program execution is broken to view the run-time screen, then press F4 again to switch back to the code screen.
Press F1 for help.

External links



Programming languages
Ada | AWK | BASIC| C | C++ | C# | COBOL | ColdFusion | Common Lisp | Delphi | Fortran | IDL | Java | JavaScript | Lisp | Perl | PHP | Prolog | Pascal | Python | SAS | SQL | Visual Basic | More programming languages
Edit this template