From collectibles to cars, buy and sell all kinds of items on eBay
home | pay | site map
Shop for itemsSell your itemTrack your eBay activitiesLearn, connect, and stay informed-for business and for funGet help, find answers and contact Customer SupportAdvanced Search
Home > Listing Index > Games > QBasic

Games - QBasic


QBasic (a name derived from QuickBASIC, BASIC being an acronym for Beginner's All-purpose Symbolic Instruction Code) is a variant of the BASIC programming language. 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.

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.

History

It was intended as a replacement for GW-BASIC, 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 more than ten years later.

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

QBasic is able to be run natively under nearly all versions of DOS and 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), Gorilla, an explosive-banana throwing game and RemLine, a GW-BASIC code line number removing program.

Code example

The following code example shows some rudimentary QBasic functionality
DO
 CLS            'This clears the screen.  It's the default first line, as it gets rid of
                'unwanted text and graphics.  By the way, the apostrophe is a comment.
                'Everything past it is ignored by QBasic, which is why I can say anything.

PRINT "Press escape to end the insane beeping! Muahaha!" 'PRINT prints text to the screen. 'The quotes tell Qbasic that the stuff 'inside is a string. PRINT can be 'replaced by a question mark "?".

DO WHILE INKEY$ <> CHR$(27) 'Checks to see if the user is pressing "escape"; the 'ASCII value of that key is represented by "CHR$(27)", 'the ASCII value of escape is 27. "DO WHILE" creates a loop, saying "Do this until 'the user whatever comes after the "DO WHILE", in our case presses escape

LET x% = INT(RND * 9000 + 100) '"LET"-This "declares" the variable. It's obsolete, so you could 'just say "x% = whatever". '"RND" generates a smallish random number. Multiplying it by 9000 'makes it a number between 1 and 9000. "+ 100" makes it between 101 'and 9000. Good. "INT" makes it an integer (number without a 'decimal point) and the "%" tells QBasic it's an integer, rather 'than, say, a string.

SOUND x%, 1 'This makes a sound, with its frequency (pitch) being "x". This number has to 'be between 36 and some high number like 36000 or something, but you can't hear a 'pitch of more than 9000 or so. ", 1" says that the sound will last 1 ' clock tick. A clock tick in QBasic happens 18 times a second. 'So, this program will make some crazy beeps.

[ Visit the complete Wikipedia entry for QBasic ]


Searches on eBay

Some related entries: Mister Ed | Eastside Hockey Manager | Mossdeep City | Human Head Studios | Grünfeld Defence | BattleDragons | Ichthyosaur | Kris Burm | Bunny hopping | Stratagus | Fruit Basket Turnover

eBay Pulse | eBay Reviews | eBay Stores | Half.com | Kijiji | PayPal | Popular Searches | ProStores | Rent.com | Shopping.com
Australia | Austria | Belgium | China | France | Germany | India | Italy | Spain | United Kingdom

About eBay | Announcements | Security Center | Policies | Site Map | Help