ebooksgratis.com

See also ebooksgratis.com: no banners, no cookies, totally FREE.

CLASSICISTRANIERI HOME PAGE - YOUTUBE CHANNEL
Privacy Policy Cookie Policy Terms and Conditions
QBasic - Wikipedia, the free encyclopedia

QBasic

From Wikipedia, the free encyclopedia

QBasic
The opening screen of QBasic.
Appeared in 1991 - 2000
Developer Microsoft Corporation
OS MS-DOS, Windows 95, Windows 98, Windows Me, PC-DOS, OS/2, eComStation
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.

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.

Contents

[edit] History

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 PC-DOS 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. (But, some localized versions of Windows 2000 and Windows XP still have it.)

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

QBasic (as well as the built-in MS-DOS Editor) is backward compatible with DOS releases prior to 5.0 (down to at least DOS 3.20). However, if used on any 8088/8086 computers, or on some 80286 computers, the QBasic program may run very slowly, or perhaps not at all, due to its memory size.

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 four 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 2647, "MONEY MANAGER", a personal finance manager and "RemLine", a GW-BASIC code line number removing program.

[edit] "Hello, World!" example

PRINT "Hello, World!"

[edit] And some other examples

CLS
PRINT "Welcome to the number guessing game"            ' Prints Welcome to the number guessing game
INPUT "Would you like to play"; choice$                ' An input statement, that takes what the user inputs...
guesses = 3                                            ' Set up number of guess remaining
IF UCASE$(choice$) <> "YES" THEN
   GOTO QUIT                                           ' Decides whether or not they want to play
END IF
 
RANDOMIZE TIMER                                        ' Sets up for randomized numbers
target = INT(RND * 10) + 1
 
WHILE guesses > 0
  INPUT "Guess a number: ", guess                      ' Takes user input (the guess)
  IF guess = target THEN                               ' Determines if the guess was correct
    PRINT "You win!"
    GOTO QUIT
  ELSE
    PRINT "Sorry, that's not it"
    guesses = guesses - 1
  END IF
WEND
 
PRINT "You ran out of guesses, the number was"; target
 
QUIT:

[edit] Trivia

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.

[edit] See also

Wikibooks
Wikibooks has a book on the topic of

[edit] External links


aa - ab - af - ak - als - am - an - ang - ar - arc - as - ast - av - ay - az - ba - bar - bat_smg - bcl - be - be_x_old - bg - bh - bi - bm - bn - bo - bpy - br - bs - bug - bxr - ca - cbk_zam - cdo - ce - ceb - ch - cho - chr - chy - co - cr - crh - cs - csb - cu - cv - cy - da - de - diq - dsb - dv - dz - ee - el - eml - en - eo - es - et - eu - ext - fa - ff - fi - fiu_vro - fj - fo - fr - frp - fur - fy - ga - gan - gd - gl - glk - gn - got - gu - gv - ha - hak - haw - he - hi - hif - ho - hr - hsb - ht - hu - hy - hz - ia - id - ie - ig - ii - ik - ilo - io - is - it - iu - ja - jbo - jv - ka - kaa - kab - kg - ki - kj - kk - kl - km - kn - ko - kr - ks - ksh - ku - kv - kw - ky - la - lad - lb - lbe - lg - li - lij - lmo - ln - lo - lt - lv - map_bms - mdf - mg - mh - mi - mk - ml - mn - mo - mr - mt - mus - my - myv - mzn - na - nah - nap - nds - nds_nl - ne - new - ng - nl - nn - no - nov - nrm - nv - ny - oc - om - or - os - pa - pag - pam - pap - pdc - pi - pih - pl - pms - ps - pt - qu - quality - rm - rmy - rn - ro - roa_rup - roa_tara - ru - rw - sa - sah - sc - scn - sco - sd - se - sg - sh - si - simple - sk - sl - sm - sn - so - sr - srn - ss - st - stq - su - sv - sw - szl - ta - te - tet - tg - th - ti - tk - tl - tlh - tn - to - tpi - tr - ts - tt - tum - tw - ty - udm - ug - uk - ur - uz - ve - vec - vi - vls - vo - wa - war - wo - wuu - xal - xh - yi - yo - za - zea - zh - zh_classical - zh_min_nan - zh_yue - zu -