1. Overview of the BASIC Language
This brief overview highlights the features of the OpenVMS
implementation of BASIC. The features listed here are
described fully in subsequent chapters of this manual, as
well as in the other two manuals in the documentation set.
BASIC was originally developed for students with little
or no programming experience. Since then, BASIC has
become one of the most widely used programming languages
and is available on almost every computer system. The
OpenVMS implementation of BASIC has evolved beyond the
original design; however, it still supports all of the traditional
features of the original language in addition to more recent
programming techniques. It has become much more than
a teaching tool and is used in a wide variety of sophisticated
applications.
BASIC is a powerful structured programming language
designed for novice and application programmers alike. The
language provides both a highly interactive programming
environment and a high-performance development language.
BASIC supports the following language constructs:
.
Code without line numbers (traditional line numbers are
optional)
.
Control structures, such as SELECT CASE
.
Explicit variable declarations
.
Capabilities for handling dynamic strings
.
Adaptable file-handling capabilities for terminal-format
files, and the full range of RMS facilities
.
Global and local run-time error handling with WHEN
ERROR blocks
.
Compile-time directives
.
A variety of data types, including packed-decimal and
user-defined records
.
Extensive error checking with meaningful error
messages
.
Thirty-one character names for variables, labels,
functions, and subprograms
BASIC uses the OpenVMS operating system to its full
advantage and is integrated with many other Digital
products. In particular, BASIC supports:
.
Interactive graphics (VAX BASIC only)
1
.
The OpenVMS systems standard calling procedures
.
Record definitions included from the OpenVMS Common
Data Dictionary
.
Code analysis with the DEC Performance and Coverage
Analyzer (PCA)
.
Creation of code with the DEC Language-Sensitive Editor
(LSE)
.
Extensive online language help
.
Exchange of data with other systems using DECnet
BASIC supports the features of other versions of BASIC,
including PDP-11 BASIC-PLUS-2. BASIC is a functional
superset of BASIC-PLUS-2. Compatibility flags for BASIC-
PLUS-2 and ANSI Minimal BASIC allow you to check
whether the programs will run on other systems.
When you write programs in BASIC, you can choose between
two program development methods: developing programs at
DCL command level or developing programs from within
the BASIC environment
2
. When you develop programs at
DCL level, you write your source program with a text editor,
then compile, link, and run the program with commands
to the OpenVMS operating system. Alternatively, when you
develop programs within the BASIC environment, you type
the DCL command BASIC to enter the environment, enter
your program, then execute it with the BASIC command
RUN.