Encyclopedia > Microsoft GW-BASIC interpreter

  Article Content

Microsoft GW-BASIC interpreter

GW-BASIC (GW being short for gee-whiz) was a dialect of BASIC which was provided free with MS-DOS operating systems on IBM PCs by Microsoft. Like other early microcomputer versions of BASIC, GW-BASIC lacked many of the structures needed for structured programming such as local variables and also suffered from slowing due to the fact that it was an interpreted programming language. The language, however, had a large number of graphics commands.

Still, it had enough horsepower to allow one to write simple games, business programs and the like. Since it was available on any PC, it was also a cheap way for would-be programmers to learn the rudiments of computer programming. It also provided a way to develop impressive science fair projects for aspiring students willing to deal with the frustrations of programming in such a spartan system.

GW-BASIC has no Integrated Development Environment (IDE) system of any sort; all program lines must be numbered, and non-numbered lines are considered to be in direct mode (executed immediately). The interface is almost completely command-line, except for the function key[?] shortcuts at the bottom and an initial copyright notice at the top of the screen. Files are normally saved in a GW-BASIC binary compressed format with tokens[?] replacing commands; however, it has an option to save as ASCII.

GW-BASIC has commands to RUN, LOAD, SAVE, LIST the current program, or quit to the operating SYSTEM, which are rarely used inside a program. All IF conditional statements[?] must be written on one line, with GOTOs used extensively. Structured programming in GW-BASIC is very rudimentary. For example, functions can only be defined using a one-line DEF FNx(y)=<something on y> statement (e.g., DEF FNLOG(base,number)=LOG(number)/LOG(base)). Variables are typed via the last symbol of their name: a$ is a string, a% is an integer, etc. Unidentified variables are single-precision.

GW-BASIC allowed for the pen-input[?] devices of its time, but not for mice. (It is possible to use pen-input commands for mice, but the reliability of the mouse responding properly to pen requests is poor.) Also, GW-BASIC can read from and write to files, LPT ports[?], and COM ports[?]; it can also do event trapping for ports. It cannot handle tape devices[?]. It is able to play music using the PLAY statement (PLAY "edcdeee2dfedc4") or the SOUND statement, requiring a frequency in Hertz and a length in clock ticks. The sound generated is typically played through an internal speaker. The sound produced is very low quality, since the internal speaker was generally used for beeps and program alerts.

GW-BASIC was eventually superseded by the Microsoft BASICA interpreter, and later the Microsoft QuickBASIC compiler. GW-BASIC's main advantage over BASICA was that it did not require a BASIC interpreter on the ROM.



All Wikipedia text is available under the terms of the GNU Free Documentation License

 
  Search Encyclopedia

Search over one million articles, find something about almost anything!
 
 
  
  Featured Article
Wheatley Heights, New York

... -73.366895)1. According to the United States Census Bureau, the town has a total area of 3.5 km² (1.4 mi²). 3.5 km² (1.4 mi²) of it is land ...

 
 
 
This page was created in 38.2 ms