Hardware Reference
In-Depth Information
6 BASIC programming
Despite increasing competition from other languages such as Pascal/Delphi
and C/C++, BASIC remains extremely popular in the field of instrumentation
and process control; the language is relatively easy to learn and programs can
be quickly developed by those with little previous programming experience.
Furthermore, modern implementations of the language put it on a par with many
of its more powerful competitors. Gone are the days when BASIC programs
were constrained to show a lack of structure by the absence of control structures
such as DO ... LOOP and WHILE ... WEND . Furthermore, BASIC procedures,
subprograms, and user-defined functions all aid the programmer since they
promote modularity and aid flexibility.
The availability of compilers adds a further dimension to the language since
compiled BASIC programs can be indistinguishable from those written in other
(supposedly superior) languages. Such programs are compact, execute at high
speed, and are relatively straightforward to develop and maintain. Such factors
conspire to make modern structured and compiled BASICs worthy contenders
for most applications within the field of instrumentation and control.
Since the majority of readers will have at least a passing acquaintance with
the BASIC programming language, we shall deal only with topics which are
directly relevant to the development of efficient programs for instrumentation
and control applications. Readers with no previous knowledge are advised to
consult one of the many tutorial topics aimed at newcomers to BASIC program-
ming (see Appendix E). There is no shortage of material to choose from and
most texts will provide a more than adequate introduction to the subject. We
begin this chapter by introducing some of the most popular BASIC compilers
including those that were developed strictly for a DOS environment as well as
more modern variants designed to fully exploit the features offered by the 32-bit
Windows operating system.
Microsoft BASIC for
DOS
To simplify some of the terminology, I've coined the phrase 'Microsoft BASIC
for DOS' to encompass a number of BASIC compilers and associated devel-
opment tools produced by Microsoft over the last two decades. Such tools
include QuickBASIC, BASIC 6.0, and the BASIC 7.1 Professional Develop-
ment System. Later versions of QuickBASIC are also sometimes referred to as
QuickBASIC Extended (QBX).
Microsoft takes pains to stress that their BASIC for DOS products are only
certified for use with MS-DOS and PC-DOS systems and, because of this
and the advent of Visual programming languages (such as Visual BASIC)
their DOS-based products are no longer actively supported. Nevertheless,
Microsoft BASIC for DOS will work within a Windows environment but with
a few restrictions, the most notable of which is that applications that access
Search WWH ::




Custom Search