Main Page

encyclopedia.codeboy.net

 

QBasic programming language

\nCategory:Programming languages \n 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 (prints "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). \n

Code Example (prints "Hello, world")

PRINT "Hello, world"

Special Keys

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

External links

\n*
QQN: QBasic/QuickBasic News.\n** QQN's Newbies Section which includes a link for downloading QBasic.\n* The QBasic Forum: An incredible forum for QBasic (very active and very clean)\n* QBasic New Zealand: Some great downloads (many with source code), a forum.\n* Alipha's site: Inactive site but quite a few useful downloads and articles.\n* QBasic games: Open source and freeware programs, some compiled via QuickBASIC 4.5\n* QBasic posts: Huge collection of QBasic-related postings with many algorithms\n* Another good QBasic page\n* QBASIC news forum

"Do, or do not. There is no 'try'." - Yoda ('The Empire Strikes Back')