QuickBASIC
Microsoft QuickBASIC is an Integrated Development Environment and compiler for the BASIC programming language that was developed by Microsoft. QuickBASIC runs mainly on DOS, though there was also a short-lived version for the classic Mac OS. It is loosely based on GW-BASIC but adds user-defined types, improved programming structures, better graphics and disk support and a compiler in addition to the interpreter. Microsoft marketed QuickBASIC as the introductory level for their BASIC Professional Development System. Microsoft marketed two other similar IDEs for C and Pascal, viz QuickC and QuickPascal.
History
Microsoft released the first version of QuickBASIC on August 18, 1985 on a single 5.25" 360kB floppy disk. QuickBASIC version 2.0 and later contained an Integrated Development Environment, 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 multiline conditional 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.
The last version of QuickBASIC was version 4.5, although development of the Microsoft BASIC Professional Development System continued until its last release of version 7.1 in October 1990. At the same time, the QuickBASIC packaging was silently changed so that the disks used the same compression used for BASIC PDS 7.1. The Basic PDS 7.x version of the IDE was called QuickBASIC Extended, 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 was Visual 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, named QBasic, was included with MS-DOS 5 and later versions, replacing the GW-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 the Apple Macintosh operating system was launched in 1988. It was officially supported on machines running System 6 with at least 1 MB of RAM. QuickBASIC could also be run on System 7, as long as 32-bit addressing was disabled; this was not possible on Motorola 68040-based Macintosh machines.
Syntax example
, shortest version:?"Hello, World"
Hello, World, extended version:
CLS
PRINT "Hello, World"
END
99 Bottles of Beer:
LET BOTTLES = 99: LET BOTTLES$ = "99": LET BOTTLE$ = " bottles"
FOR A = 1 TO 99
PRINT BOTTLES$; BOTTLE$; " of beer on the wall, "; BOTTLES$; BOTTLE$; " of beer."
LET BOTTLES = BOTTLES - 1
IF BOTTLES > 0 THEN LET BOTTLES$ = LTRIM$: LET PRONOUN$ = "one"
IF BOTTLES = 0 THEN LET BOTTLES$ = "no more": LET PRONOUN$ = "it"
IF BOTTLES <> 1 THEN LET BOTTLE$ = " bottles"
IF BOTTLES = 1 THEN LET BOTTLE$ = " bottle"
PRINT "Take "; PRONOUN$; " down and pass it around, "; BOTTLES$; BOTTLE$; " of beer on the wall."
PRINT: NEXT A
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:
SCREEN 13
DIM a AS INTEGER, b AS INTEGER, c AS INTEGER
DIM d AS INTEGER, e AS INTEGER
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 -, a
PUT, a, PSET
LINE -, col%
IF flag = 1 THEN col% = col% + 1: IF col% = 32 THEN flag = 2
IF flag = 2 THEN col% = col% - 1: IF col% = 16 THEN flag = 1
GET -, b
PUT, b, PSET
LINE -, col1%
IF flag1 = 1 THEN col1% = col1% + 1: IF col1% = 32 THEN flag1 = 2
IF flag1 = 2 THEN col1% = col1% - 1: IF col1% = 16 THEN flag1 = 1
GET -, c
PUT, c, PSET
LINE -, col2%
IF flag2 = 1 THEN col2% = col2% + 1: IF col2% = 32 THEN flag2 = 2
IF flag2 = 2 THEN col2% = col2% - 1: IF col2% = 16 THEN flag2 = 1
GET -, d
PUT, d, PSET
LINE -, col3%
IF flag3 = 1 THEN col3% = col3% + 1: IF col3% = 32 THEN flag3 = 2
IF flag3 = 2 THEN col3% = col3% - 1: IF col3% = 16 THEN flag3 = 1
GET -, e
PUT, e, PSET
LINE -, col4%
IF flag4 = 1 THEN col4% = col4% + 1: IF col4% = 32 THEN flag4 = 2
IF flag4 = 2 THEN col4% = col4% - 1: IF col4% = 16 THEN flag4 = 1
LOOP UNTIL LEN
Bubble sort:
REM sample of bubble sort
N = 10
DIM A AS INTEGER
FOR L = 1 TO N
A = INT
NEXT
FOR X = 1 TO N
FOR Y = 1 TO N - 1
IF A < A THEN SWAP A, A
NEXT
NEXT
FOR L = 1 TO N
PRINT A
NEXT
END
Current uses
QuickBASIC has an unofficial community of hobby programmers who use the compiler to write video games, GUIs and utilities. The community has dedicated several Web sites, message boards and online magazines to the language.Today, programmers sometimes use DOS emulators, such as DOSBox, to run QuickBASIC on Linux and on modern personal computer hardware that no longer supports the compiler. Alternatives to this include FreeBASIC and QB64, but they cannot yet run all QBasic/QuickBASIC programs.
Since 2008, a set of TCP/IP routines for QuickBASIC 4.x and 7.1 has revitalized some interest in the software. In particular, the vintage computer hobbyist community has been able to write software for old computers that run DOS, allowing these machines to access other computers through a LAN or the internet. This has allowed systems even as old as an 8088 to serve new functions, such as acting as a Web server or using IRC.