QBasic Information Center Tutorials - Overview
These tutorials were written to help you get a quick, but thorough, understanding of QBasic -
the scope of the language as well as it's specific capabilities.
QBasic Overview
QBasic has features common to many other languages. It does use the common BASIC
syntax (vs C-style used by several other popular languages), but otherwise
uses standard operators, has typed variables, comes with a wide variety of
built-in functions, supports subroutines/functions, provides flow control,
handles files, and can call on system resources. All of these are covered in this
tutorial.
Creating & Executing Programs
QBasic programs consist of text statements which are stored in text files that can
be edited by any text editor, such as the free Windows NotePad. There are literally
hundreds of programmer's editors (text editors with special features to improve
a programmer's productivity) which can be used to edit QBasic code. However
the QBasic built-in text editor is usually adequate for most QBasic programmer needs.
QBasic is an interpreted language, meaning that the source code is read and executed
line by line. No executable (EXE) file is created by QBasic (see below for a work-around).
Applications
Interpreted programs generally run slower than the corresponding compiled programs,
so QBasic programs are often used where speed is not an issue. Programmers often create
"throw-away" QBasic programs - those which are used just once to perform a specific task,
where getting the job done is more important than how long it takes.
Another major use of QBasic was to create games - lots of games. Despite its very
minimal graphics capabilities, the fact that it was free and readily available as part
of the MS-DOS 5/6 distributions gave it wide acceptance by programmers, especially young
programmers whose primary interest was games. These, and later, programmers pushed
Compilation, Anyways!
A major problem with QBasic interpreted programs is users had to have QBasic on their
PC and needed to be at least somewhat familiar with its use. This made distribution
of executables far more preferable than then distribution of interpreted versions.
The good news is that the QuickBasic compiler (BASCOM) can be used to compile QBasic
programs. QuickBasic, the Microsoft commercial product from which QBasic was derived,
is no longer sold but continues to be available for download on the web. Microsoft appears
to allow its distribution "unofficially" but still owns the copyright to the product.
Program Flow
Execution of a QBasic program begins with the first line of source code and ends
with the last line of code, although an "End" command can be used to stop the program
at any time.
Limitations
Simply put, QBasic is too limited to be a professional programmer's language of choice.
Still, there are thousands of programmers who continue to use QBasic, as can you if the
following limitations are acceptable.
If you have any suggestions or questions, please let me know.
|