QBasic

From Wikipedia, the free encyclopedia

(Redirected from QBasic programming language)
Jump to: navigation, search
QBasic
The opening screen of QBasic.
Appeared in 1991 - 2000
Developer Microsoft Corporation
OS MS-DOS, Windows 95, Windows 98, Windows Me
License MS-EULA
Website www.microsoft.com

QBasic is an IDE and interpreter for a variant of the BASIC programming language which is based on QuickBasic. Code entered into the IDE is compiled to an intermediate form, and this intermediate form is immediately interpreted on demand within the IDE.

Contents

Like QuickBASIC, but unlike earlier versions of Microsoft BASIC, QBasic is a structured programming language, supporting constructs such as subroutines and while loops. Line numbers, a concept often associated with BASIC, are supported for compatibility, but are 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.

QBasic was intended as a replacement for GW-BASIC. Version 1.0 was shipped together with MS-DOS 5.0 and higher, as well as Windows 95, Windows NT 3.x, and Windows NT 4.0. IBM recompiled QBasic and included it in PCDOS 5.x, as well as OS/2 2.0 onwards. eComStation, decended from OS/2 code, includes QBasic 1.0. QBasic 1.1 is included with MS-DOS 6.x, and, without EDIT, in Windows 95, Windows 98 and Windows Me. Starting with Windows 2000, Microsoft no longer includes QBasic with their operating systems.

It was based on the earlier QuickBASIC 4.5 compiler but without QuickBASIC's compiler and linker elements. Until MS-DOS 7, the MS-DOS editor required QBasic. The "edit.com" program simply started QBasic in editor mode only.

Although QBasic (along with the built-in MS-DOS Editor) was first introduced as part of the MS-DOS 5.0 Package, it did not depend specifically on MS-DOS 5.0 to run. QBASIC (and the Editor) could be used with previous versions of DOS, down to at least version 3.20. However, sufficient memory and a reasonably fast CPU were still needed, otherwise the program would run very slowly.

For its time, QBasic provided a state-of-the-art IDE, including a debugger with features such as on-the-fly expression evaluation and code modification that were still relatively unusual more than ten years later.

QBasic is able to be run natively under nearly all versions of DOS and of Windows, and by using the free DOSBox emulator, it can run on platforms such as Linux and FreeBSD.

QBasic came complete with a couple of pre-written example programs. These were Nibbles (a variant of the Snake game), Gorillas, an explosive-banana throwing game derived from Artillery Game first produced on the Tektronix 4051 and later HP 2640 HP 2647 and RemLine, a GW-BASIC code line number removing program.

PRINT "Hello, World!"

QBasic has a little known easter egg. To see it, press and hold LeftCtrl+LeftShift+LeftAlt and RightCtrl+RightShift+RightAlt simultaneously after running QBasic at the DOS prompt but before the title screen loads: this lists The Team of programmers. Note that on modern computers, it is much too fast to perform. It is best done on an old PC (preferably one with a working Turbo button, with the switch on to slow the CPU to 4.77 MHz) or in an emulator like Bochs or DOSBox which can be slowed down.

Wikibooks
Wikibooks has a book on the topic of

Advanced Search
Included Web Search Engines


Safe Search

close

Top Matching Results

Occasionally Search.com will highlight specialized results that are based on the context of your query. Examples of specialized results include specific links to news, images, or video.

Top Matching Results may highlight information from other Search.com pages, content from the CNET Network of sites, or third party content. The listings are based purely on relevance. Search.com does not receive payment for listings in this section but our partners that provide this data may get paid for listing these products.

Sponsored Links

This section contains paid listings which have been purchased by companies that want to have their sites appear for specific search terms and related content. These listings are administered, sorted and maintained by a third party and are not endorsed by Search.com.

Search Results

Search.com sends your search query to several search engines at one time and integrates the results into one list which has been sorted by relevance using Search.com's proprietary algorithm. You can customize the list of search engines included in your metasearch from the preferences.

The search engines that are used in your metasearch may allow companies to pay to have their Web sites included within the results. To view the Paid Inclusion policy for a specific search engine, please visit their Web site. Search.com does not accept payment or share revenue with any search engine partner for listings in this section.