| QuickBASIC | |
|---|---|
Opening screen | |
| Developer | Microsoft |
| Initial release | 1985; 41 years ago (1985) |
| Stable release | 7 / 1990; 36 years ago (1990) |
| Operating system | MS-DOS,Classic Mac OS |
| Platform | x86,Motorola 68000 |
| Type | Microsoft BASIC |
| License | Proprietary |
Microsoft QuickBASIC (alsoQB) is anIntegrated Development Environment (or IDE) andcompiler for theBASICprogramming language that was developed byMicrosoft. QuickBASIC runs mainly onMS-DOS, though there was also a short-lived version forClassic Mac OS. It is loosely based onGW-BASIC but adds user-defined types, improved programming structures, better graphics and disk support and a compiler in addition to theinterpreter. Microsoft marketed QuickBASIC as the introductory level for their BASIC Professional Development System.[1] Microsoft marketed two other similar IDEs for C and Pascal, vizQuickC andQuickPascal.
Microsoft released the first version of QuickBASIC on August 18, 1985 on a single 5.25-inch 360 KBfloppy disk. QuickBASIC version 2.0 and later contained anIntegrated Development Environment (IDE), allowing users to edit directly in its on-screen text editor.
Although still supported in QuickBASIC, line numbers became optional. Program jumps also worked with named labels. Later versions also added control structures, such as multilineconditional statements and loop blocks.
Microsoft's "PC BASIC Compiler" was included for compiling programs into DOS executables. Beginning with version 4.0, the editor included an interpreter that allowed the programmer to run the program without leaving the editor. The interpreter was used to debug a program before creating an executable file. Unfortunately, there were some subtle differences between the interpreter and the compiler, which meant that large programs that ran correctly in the interpreter might fail after compilation, or not compile at all because of differences in the memory management routines.[2]
The last version of QuickBASIC was version 4.5 (1988), although development of the Microsoft BASIC Professional Development System (PDS) continued until its last release of version 7.1 in October 1990.[3] At the same time, the QuickBASIC packaging was silently changed so that the disks used the same compression used for BASIC PDS 7.1.[4] The Basic PDS 7.x version of the IDE was called QuickBASIC Extended (QBX), and it only ran on DOS, unlike the rest of Basic PDS 7.x, which also ran on OS/2.
QuickBASIC 4.5 was the subject of numerous books, articles, and programming tutorials, and arrived near the high-point of BASIC saturation in the PC marketplace. In 1989, Microsoft Press bundled the QuickBASIC Interpreter into a book-and-software learning system calledLearn BASIC Now. The product was priced at $39.95 and included a Foreword written by Bill Gates, who reported that BASIC was in active use by over four million PC users.[5]
The successor to QuickBASIC and Basic PDS wasVisual Basic version 1.0 for MS-DOS, shipped in Standard and Professional versions. Later versions of Visual Basic did not include DOS versions, as Microsoft concentrated on Windows applications.
A subset of QuickBASIC 4.5, namedQBasic, was included withMS-DOS 5 and later versions, replacing theGW-BASIC included with previous versions of MS-DOS. Compared to QuickBASIC, QBasic is limited to an interpreter only, lacks a few functions, can only handle programs of a limited size, and lacks support for separate program modules. Since it lacks a compiler, it cannot be used to produce executable files, although its program source code can still be compiled by a QuickBASIC 4.5, PDS 7.x or VBDOS 1.0 compiler, if available.
QuickBASIC 1.00 for theApple Macintosh operating system was launched in 1988. It was officially supported on machines runningSystem 6 with at least 1 MB of RAM.[6] QuickBASIC could also be run onSystem 7, as long as 32-bit addressing was disabled. QuickBASIC programming was significantly different on the Macintosh, because the system offered a graphical user interface and an event-driven programming model.[7]
Hello, World, shortest version:
?"Hello, World"
Hello, World, extended version:
CLSPRINT"Hello, World"END
LETBOTTLES=99:LETBOTTLES$="99":LETBOTTLE$=" bottles"FORA=1TO99PRINTBOTTLES$;BOTTLE$;" of beer on the wall, ";BOTTLES$;BOTTLE$;" of beer."LETBOTTLES=BOTTLES-1IFBOTTLES>0THENLETBOTTLES$=LTRIM$(STR$(BOTTLES)):LETPRONOUN$="one"IFBOTTLES=0THENLETBOTTLES$="no more":LETPRONOUN$="it"IFBOTTLES<>1THENLETBOTTLE$=" bottles"IFBOTTLES=1THENLETBOTTLE$=" bottle"PRINT"Take ";PRONOUN$;" down and pass it around, ";BOTTLES$;BOTTLE$;" of beer on the wall."PRINT:NEXTAPRINT"No more bottles of beer on the wall, no more bottles of beer."PRINT"Go to the store and buy some more, 99 bottles of beer on the wall."
Graphics example:
SCREEN13DIMa(3976)ASINTEGER,b(3976)ASINTEGER,c(3976)ASINTEGERDIMd(3976)ASINTEGER,e(3976)ASINTEGERcol%=16:col1%=16:col2%=16:col3%=16:col4%=16col5%=16:col6%=16:col7%=16:flag=1:flag1=1flag2=1:flag3=1:flag4=1:flag5=1:flag6=1:flag7=1DOGET(1,38)-(318,62),aPUT(2,38),a,PSETLINE(1,38)-(1,62),col%IFflag=1THENcol%=col%+1:IFcol%=32THENflag=2IFflag=2THENcol%=col%-1:IFcol%=16THENflag=1GET(2,63)-(319,87),bPUT(1,63),b,PSETLINE(319,63)-(319,87),col1%IFflag1=1THENcol1%=col1%+1:IFcol1%=32THENflag1=2IFflag1=2THENcol1%=col1%-1:IFcol1%=16THENflag1=1GET(1,88)-(318,112),cPUT(2,88),c,PSETLINE(1,88)-(1,112),col2%IFflag2=1THENcol2%=col2%+1:IFcol2%=32THENflag2=2IFflag2=2THENcol2%=col2%-1:IFcol2%=16THENflag2=1GET(2,113)-(319,137),dPUT(1,113),d,PSETLINE(319,113)-(319,137),col3%IFflag3=1THENcol3%=col3%+1:IFcol3%=32THENflag3=2IFflag3=2THENcol3%=col3%-1:IFcol3%=16THENflag3=1GET(1,138)-(318,162),ePUT(2,138),e,PSETLINE(1,138)-(1,162),col4%IFflag4=1THENcol4%=col4%+1:IFcol4%=32THENflag4=2IFflag4=2THENcol4%=col4%-1:IFcol4%=16THENflag4=1LOOPUNTILLEN(INKEY$)
REM sample of bubble sortN=10DIMA(1TON)ASINTEGERFORL=1TONA(L)=INT(RND*10+1)NEXTFORX=1TON-1FORY=X+1TONIFA(X)<A(Y)THENSWAPA(X),A(Y)NEXTNEXTFORL=1TONPRINTA(L)NEXTEND
QuickBASIC has a community of hobby programmers who use the compiler to writevideo games,GUIs andutilities.[8][9][10] The community has several Web sites,message boards andonline magazines.[11][12]
Today, programmers sometimes use DOSemulators, such asDOSBox, to run QuickBASIC onLinux and on modernpersonal computers that no longer support the compiler.[13][14] Alternatives to this includeFreeBASIC andQB64, but they cannot yet runall QBasic/QuickBASIC programs.[15]
Since 2008, a set ofTCP/IP routines for QuickBASIC 4.x and 7.1 has revitalized some interest in the software. In particular, thevintage computer hobbyist community has been able to write software for old computers that run DOS, allowing these machines to access other computers through aLAN or the internet. This has allowed systems even as old as an8088 to serve new functions, such as acting as aWeb server or usingIRC.[16]
Microsoft'sVisual Basic was the successor of QuickBASIC. Other compilers, likePowerBASIC andFreeBASIC, have varying degrees of compatibility.QB64, amultiplatform QuickBASIC to C++ translator, retains close to 100% compatibility and compiles natively forWindows,Linux andmacOS.[17]