2.5.2.3 COMPILE Command
When compiling a program in the BASIC environment, there
are three levels at which you can specify options for the
compiler:
.
Accept the defaults of the BASIC environment as options
.
Specify options with qualifiers to the COMPILE or SET
command
.
Specify options in the source program with the OPTION
statement
The COMPILE command creates an object module from a
source program in memory. You can control the compila-
tion of your program with the COMPILE command and its
qualifiers. These qualifiers duplicate many of the qualifiers
available to the DCL command BASIC. You can abbrevi-
ate all COMPILE qualifiers to four letters. For example, you
can compile a program currently in memory and specify the
creation of a listing file:
COMPILE/LIST
The following two commands both specify that a listing file is
created. Note that the SET command sets a particular de-
fault until you leave the BASIC environment or until you
specify a different default for that value, and the qualifiers
to the COMPILE command set the defaults only for that
particular compilation.
SET/LIST
COMPILE/LIST
If you do not specify any qualifiers with the SET command,
BASIC resets the defaults to the values that were in effect
when you entered the BASIC environment.
The qualifiers to the COMPILE command are shown in the
following list. Note that you can also use many of these qual-
ifiers with the SET command to establish these compiler
options. The qualifiers are described fully in the DEC BASIC
and VAX BASIC for OpenVMS Systems Reference Manual .
.
The /[NO]ANSI_STANDARD qualifier instructs
VAX BASIC to compile the program according to ANSI
Minimal BASIC rules and to flag statements that do not
conform to the ANSI Minimal BASIC standard. Note
that the /ANALYSIS_DATA qualifier cannot be in effect
when compiling with the /ANSI_STANDARD qualifier.
The default is /NOANSI_STANDARD.
.
The /[NO]AUDIT qualifier instructs VAX BASIC to in-
clude a history entry in the CDD/Repository database
when a CDD/Repository definition is extracted.
The default is /NOAUDIT.
.
The /[NO]BOUNDS qualifier instructs VAX BASIC to
perform range checks on array subscripts. This qualifier
checks that all array references are to addresses within
the array boundaries.
The default is /BOUNDS.
.
The /BYTE qualifier specifies that integers not explic-
itly typed with a data type keyword use 8 bits of storage,
which lets you use integer values from -128 to 127.
The default is /INTEGER_SIZE=LONG.
.
The /[NO]CROSS_REFERENCE[=[NO]KEYWORDS]
qualifier instructs VAX BASIC to generate a cross-
reference listing. If you specify KEYWORDS, VAX BASIC
provides a cross-reference list of BASIC keywords. If you
specify /CROSS_REFERENCE, the default is /CROSS_
REFERENCE=NOKEYWORDS.
The default is /NOCROSS_REFERENCE.
.
The /[NO]DEBUG qualifier provides the debugger with
local symbol definitions for program variables, constants,
line numbers, and labels. If you make changes to a pro-
gram within the environment, you must first save or
replace the program before attempting to compile the
program with the /DEBUG qualifier; otherwise, BASIC
signals the error ``Unsaved changes, no source line de-
bugging available''.
The default is /DEBUG=(TRACEBACK,NOSYMBOLS).
.
The /DECIMAL_SIZE qualifier specifies the default size
and precision for all DECIMAL data not explicitly as-
signed size and precision in the program. You specify
the total number of digits ( d ) and the number of dig-
its to the right of the decimal point ( s ). BASIC signals
the error ``Decimal error or overflow'' (ERR=181) when
DECIMAL values are outside the range specified with
this qualifier.
The default is /DECIMAL_SIZE=(15,2).
.
The /DOUBLE qualifier specifies that floating-point data
use 64 bits of storage in D_float format, which lets you
use floating-point values in the range 2.9
*
10
39
to 1.7
*
10
38
and with up to 16 digits of precision.
The default is /REAL_SIZE=SINGLE.
.
The /[NO]FLAG[=( [NO]AXPCOMPATIBILITY,
[NO]BP2COMPATIBILITY,[NO]DECLINING)]
qualifier instructs VAX BASIC to issue informational
messages when your program includes statements
that are not compatible with the features you spec-
ify. You can specify a flag for compatibility with DEC
BASIC (AXPCOMPATIBILITY), BASIC-PLUS-2
(BP2COMPATIBILITY), and declining BASIC language
features (DECLINING).
The default is /NOFLAG.
.
The /GFLOAT qualifier specifies that floating-point data
use 64 bits of storage in G_float format, which lets you
use floating-point values in the range 5.6
*
10
308
to 9.0
*
10
309
and with up to 15 digits of precision.
The default is /REAL_SIZE=SINGLE.
.
The /HFLOAT qualifier specifies that floating-point data
use 128 bits of storage in H_float format, which lets you
use floating-point values in the range 8.4
*
10
4933
to 5.9
*
10
4933
and with up to 33 digits of precision.
The default is /REAL_SIZE=SINGLE.
.
The /[NO]LINES qualifier enables the executing program
to report the line number of statements causing errors
and to use the RESUME statement without specifying a
line number.
The default is /LINES.
.
The /[NO]LIST qualifier creates a program listing with a
default file type of .LIS.
The default is /NOLIST.
.
The /LONG qualifier specifies that untyped integers use
32 bits of storage, which lets you use integer values from
-2147483648 to 2147483647.
The default is /INTEGER_SIZE=LONG.
.
The /[NO]MACHINE_CODE qualifier includes the
compiler-generated assembly code listing.
The default is /NOMACHINE_CODE.
.
The /[NO]OBJECT qualifier generates a linkable object
module. This object module has the same file name as the
BASIC source program and a default file type of .OBJ.
The default is /OBJECT.
.
The /[NO]OVERFLOW[=([NO]INTEGER,[NO]DECIMAL)]
qualifier enables the detection of arithmetic overflow on
integer or packed decimal data. If you do not supply a
value, OVERFLOW affects both data types.
The default is /OVERFLOW=(INTEGER,DECIMAL).
.
The /[NO]ROUND qualifier specifies whether BASIC
rounds or truncates packed decimal numbers.
The default is /NOROUND.
.
The /[NO]SETUP qualifier causes BASIC to optimize the
executable image by omitting certain calls to the Run-
Time Library at the start and end of each program unit.
Note that variables are not initialized when /NOSETUP is
in effect.
The default is /SETUP.
.
The /[NO]SHOW qualifier allows you to specify what
is included in the listing file. For a list of items you
can include in the listing file, see the DEC BASIC and
VAX BASIC for OpenVMS Systems Reference Manual .
The default is /SHOW.
.
The /SINGLE qualifier specifies that floating-point data
use 32 bits of storage, which lets you use floating-point
values in the range 2.9
*
10
39
to 1.7
*
10
38
and with up
to 6 digits of precision.
The default is /REAL_SIZE=SINGLE.
.
The /[NO]SYNTAX_CHECK qualifier enables line-
by-line syntax checking. Because BASIC automatically
performs syntax checking when you compile a program,
you normally use /SYNTAX_CHECK with the SET com-
mand to enable line-by-line syntax checking while you
are typing program lines.
The default is /NOSYNTAX_CHECK.
.
The /[NO]TRACEBACK qualifier provides line numbers
for the debugger and error reporter so they can translate
virtual addresses into source program module names and
line numbers.
The default is /TRACEBACK.
.
The /TYPE_DEFAULT qualifier allows you to specify
the default data type for all data not explicitly typed in
your program. See the DEC BASIC and VAX BASIC for
OpenVMS Systems Reference Manual for a list of data
types you can include.
The default is /TYPE_DEFAULT=REAL.
.
The /VARIANT=value qualifier provides a value to be
tested in conditional compilations.
The default is /VARIANT=0.
.
The /[NO]WARNINGS[=[NO]WARNINGS,[NO]INFORMATIONALS]
qualifier tells VAX BASIC whether to display warning or
informational error messages. The /NOWARNINGS
qualifier instructs VAX BASIC to not display any infor-
mational or warning errors.
The default is /WARNINGS=WARNINGS,INFORMATIONALS.
.
The /WORD qualifier specifies that all integer data not
explicitly typed use 16 bits of storage, which lets you use
integer values from -32768 to 32767.
The default is /INTEGER_SIZE=LONG.
If you specify the /DIAGNOSTICS qualifier or the /ANALYSIS_
DATA qualifier with the BASIC command, then make
changes to a program and attempt to compile the program
before saving or replacing it, VAX BASIC signals the error
``Unsaved changes, no diagnostics file produced'' or ``Unsaved
changes, no analysis file produced''. You must save or replace
the program before you compile it to generate a diagnostics
or data analysis file.