QuickBASIC
![]() Opening screen | |
Developer(s) | Microsoft |
---|---|
Initial release | 1985 |
Stable release | 7
/ 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) andcompilerfor theBASICprogramming languagethat was developed byMicrosoft.QuickBASIC runs mainly onDOS,though there was also a short-lived version for theclassic Mac OS.It is loosely based onGW-BASICbut 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, vizQuickCandQuickPascal.
History
[edit]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 statementsand 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. The successor to QuickBASIC and Basic PDS wasVisual Basicversion 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-DOS5 and later versions, replacing theGW-BASICincluded 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 Macintoshoperating system was launched in 1988. It was officially supported on machines runningSystem 6with at least 1 MB of RAM.[5]QuickBASIC could also be run onSystem 7,as long as 32-bit addressing was disabled.
Syntax example
[edit]Hello, World,shortest version:
?"Hello, World"
Hello, World,extended version:
CLS
PRINT"Hello, World"
END
LETBOTTLES=99:LETBOTTLES$="99":LETBOTTLE$="bottles"
FORA=1TO99
PRINTBOTTLES$;BOTTLE$;"of beer on the wall,";BOTTLES$;BOTTLE$;"of beer."
LETBOTTLES=BOTTLES-1
IFBOTTLES>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:NEXTA
PRINT"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:
SCREEN13
DIMa(3976)ASINTEGER,b(3976)ASINTEGER,c(3976)ASINTEGER
DIMd(3976)ASINTEGER,e(3976)ASINTEGER
col%=16:col1%=16:col2%=16:col3%=16:col4%=16
col5%=16:col6%=16:col7%=16:flag=1:flag1=1
flag2=1:flag3=1:flag4=1:flag5=1:flag6=1:flag7=1
DO
GET(1,38)-(318,62),a
PUT(2,38),a,PSET
LINE(1,38)-(1,62),col%
IFflag=1THENcol%=col%+1:IFcol%=32THENflag=2
IFflag=2THENcol%=col%-1:IFcol%=16THENflag=1
GET(2,63)-(319,87),b
PUT(1,63),b,PSET
LINE(319,63)-(319,87),col1%
IFflag1=1THENcol1%=col1%+1:IFcol1%=32THENflag1=2
IFflag1=2THENcol1%=col1%-1:IFcol1%=16THENflag1=1
GET(1,88)-(318,112),c
PUT(2,88),c,PSET
LINE(1,88)-(1,112),col2%
IFflag2=1THENcol2%=col2%+1:IFcol2%=32THENflag2=2
IFflag2=2THENcol2%=col2%-1:IFcol2%=16THENflag2=1
GET(2,113)-(319,137),d
PUT(1,113),d,PSET
LINE(319,113)-(319,137),col3%
IFflag3=1THENcol3%=col3%+1:IFcol3%=32THENflag3=2
IFflag3=2THENcol3%=col3%-1:IFcol3%=16THENflag3=1
GET(1,138)-(318,162),e
PUT(2,138),e,PSET
LINE(1,138)-(1,162),col4%
IFflag4=1THENcol4%=col4%+1:IFcol4%=32THENflag4=2
IFflag4=2THENcol4%=col4%-1:IFcol4%=16THENflag4=1
LOOPUNTILLEN(INKEY$)
REM sample of bubble sort
N=10
DIMA(N)ASINTEGER
FORL=1TON
A(L)=INT(RND*10+1)
NEXT
FORX=1TON
FORY=1TON-1
IFA(X)<A(Y)THENSWAPA(X),A(Y)
NEXT
NEXT
FORL=1TON
PRINTA(L)
NEXT
END
Current uses
[edit]QuickBASIC has an unofficial community of hobby programmers who use the compiler to writevideo games,GUIsandutilities.[6][7][8]The community has dedicated several Web sites,message boardsandonline magazinesto the language.[9][10]
Today, programmers sometimes use DOSemulators,such asDOSBox,to run QuickBASIC onLinuxand on modernpersonal computersthat no longer support the compiler.[11][12]Alternatives to this includeFreeBASICandQB64,but they cannot yet runallQBasic/QuickBASIC programs.[13]
Since 2008, a set ofTCP/IProutines for QuickBASIC 4.x and 7.1 has revitalized some interest in the software. In particular, thevintage computerhobbyist community has been able to write software for old computers that run DOS, allowing these machines to access other computers through aLANor the internet. This has allowed systems even as old as an8088to serve new functions, such as acting as aWeb serveror usingIRC.[14]
Successors
[edit]Microsoft'sVisual Basicwas the successor of QuickBASIC. Other compilers, likePowerBASICandFreeBASIC,have varying degrees of compatibility.QB64,amultiplatformQuickBASIC to C++ translator, retains close to 100% compatibility and compiles natively forWindows,LinuxandmacOS.[15]
See also
[edit]References
[edit]- ^Early Microsoft documentation rendered the name exclusively as "QuickBASIC", although later references on Microsoft's Web site also use "QuickBasic".
- ^Microsoft Knowledge Base 45850: Memory Management in QuickBasic & Basic Compiler
- ^QuickBASIC 4.5 was delivered on a set of five 360 KB 5.25-inch DSDD floppy disks or three 720 KB 3.5-inch DSDD floppy disks. The three-disk version could also be installed from 1.2 MB 5.25-inch or 1.44 MB 3.5-inch DSHD disks. To save costs, the files were compressed and later versions were shipped on just four 5.25-inch disks or two 3.5-inch disks.
- ^Microsoft Knowledge Base article 65291
- ^QuickBASIC for Macintosh system requirements
- ^"QBASIC Games Directory".2008-11-29. Archived fromthe originalon 4 September 2014.Retrieved2008-12-28.
- ^"GUI Reviews".2008-12-19.Retrieved2008-12-28.
- ^"The (BASIC) GUI Blog".2011-02-06.Retrieved2011-02-06.
- ^"Qbasic/Quickbasic News".2008-12-26.Retrieved2008-12-28.
- ^"QB Express".Pete's QBASIC/QuickBasic Site. 2008.Retrieved2008-12-28.
- ^Pete Trbovich (2007-03-31)."HOWTO Play With Your Old QBasic Programs on Linux".Retrieved2008-12-28.
- ^Kiyote Wolf (2008-05-10)."Kiyote Wolf on a Variety of Subjects".QB Express.Retrieved2008-12-28.
- ^For example, FreeBASIC does not yet support QBasic's "ON PLAY" callback for background music, or the use ofPEEK and POKEtoI/O ports.
- ^Mike Chambers (2008-07-12)."rubbermallet.org: Where QuickBASIC gets much more powerful".Retrieved2008-12-28.
- ^Virtanen, E. K. (2008-05-26)."Interview With Galleon".Archived from the original on March 6, 2016.Retrieved2008-07-14.
{{cite web}}
:CS1 maint: unfit URL (link)