QBasic
|
QBasic (an acronym for 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 (IDE), and this intermediate form is immediately 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. QBasic 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.
Using the free DOSBox emulator it today runs on almost all platforms such as Windows NT, Linux, FreeBSD, etc.
QBasic came complete with a couple of pre-written example games. These were Nibbles (a variant of the Snake game) and Gorillas, an explosive-banana throwing game.
Contents |
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, having been replaced by descriptive line labels. QBasic has limited support for user-defined data types (structures), and several primitive types used to contain strings of text or numeric data.
Code Example
The following code displays "Hello, World" and makes weird sounds:
PRINT "Hello, World" FOR Note = 450 TO 750 STEP 20 SOUND Note, 1 SOUND 800 - Note, 1 NEXT Note FOR Note = 750 TO 450 STEP -20 SOUND Note, 1 SOUND 750 + Note, 1 NEXT Note FOR Note = 100 TO 1000 STEP 20 SOUND Note, 1 SOUND 750 + Note, 1 NEXT Note END
Special Keys
Press Ctrl+Break 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
- QBasic/QuickBasic News: active (http://www.qbasicnews.com/) (link (http://www.qbasicnews.com/sections.php?id=4) for downloading QBasic)
- Pete's QB Site: active, QB:Express magazine (http://www.petesqbsite.com/)
- Network54.com: active forum (http://www.network54.com/forum/13959)
- QBasic New Zealand: inactive, downloads (http://qbnz.com/)
- Alipha's site: inactive, few downloads and articles (http://www.geocities.com/aliphax/)
- Q-Basic Turkey Site News: inactive (http://qbasic.net.tc/)
- QBasic.com: inactive (http://www.qbasic.com/)
- QuickBasic Cafe: inactive, Downloads (Compilers,Tools,Libs,Tuts) Board (http://www.qbcafe.net/)
- Collection of free QBasic Tutorials (http://www.allfreetutorials.com/index.php?pg=basic-tutorials.htm)de:QBasic
es:QBASIC fr:QBasic nl:Programmeertaal QBasic pl:QBasic ru:QBASIC sv:QBasic tr:QBASIC zh:QBASIC