HP OpenVMS Systems Documentation |
HP BASIC for OpenVMS
|
Previous | Contents | Index |
The following is a list of the HP BASIC keywords. Most of the keywords are reserved; unreserved keywords are marked with a dagger (+).
%ABORT
%CDD+
%CROSS
%DEFINE
%ELSE
%END
%FROM
%IDENT
%IF
%INCLUDE
%LET
%LIBRARY
%LIST
%NOCROSS
%NOLIST
%PAGE
%SBTTL
%THEN
%TITLE
%UNDEFINE
%VARIANT
ABORT
ABS
ABS%
ACCESS
ACCESS%
ACTIVATE
ACTIVE
ALIGNED
ALLOW
ALTERNATE
AND
ANGLE+
ANY
APPEND
AREA+
AS
ASC
ASCENDING
ASCII
ASK
AT+
ATN
ATN2
BACK
BASE
BASIC
BEL
BINARY
BIT
BLOCK
BLOCKSIZE
BS
BUCKETSIZE
BUFFER
BUFSIZ
BY
BYTE
CALL
CASE
CAUSE
CCPOS
CHAIN
CHANGE
CHANGES
CHECKING
CHOICE+
CHR$
CLEAR
CLIP+
CLK$
CLOSE
CLUSTERSIZE
COLOR+
COM
COMMON
COMP%
CON
CONNECT
CONSTANT
CONTIGUOUS
CONTINUE
COS
COT
COUNT
CR
CTRLC
CVTF$
CVT$F
CVT$$
CVT$%
CVT%$
DAT
DAT$
DATA
DATE$
DEACTIVATE
DECIMAL
DECLARE
DEF
DEF*
DEFAULTNAME
DEL
DELETE
DESC
DESCENDING
DET
DEVICE
DIF$
DIM
DIMENSION
DOUBLE
DOUBLEBUF
DRAW
DUPLICATES
DYNAMIC
ECHO
EDIT$
ELSE
END
EQ
EQV
ERL
ERN$
ERR
ERROR
ERT$
ESC
EXIT
EXP
EXPAND+
EXPLICIT
EXTEND
EXTENDSIZE
EXTERNAL
FF
FIELD
FILE
FILESIZE
FILL
FILL$
FILL%
FIND
FIX
FIXED
FLUSH
FNAME$
FNEND
FNEXIT
FONT+
FOR
FORMAT$
FORTRAN
FREE
FROM
FSP$
FSS$
FUNCTION
FUNCTIONEND
FUNCTIONEXIT
GE
GET
GETRFA
GFLOAT
GO
GOBACK
GOSUB
GOTO
GRAPH
GRAPHICS+
GROUP
GT
HANDLE
HANDLER
HEIGHT+
HFLOAT
HT
IDN
IF
IFEND
IFMORE
IMAGE
IMP
IN+
INACTIVE
INDEX+
INDEXED
INFORMATIONAL
INITIAL
INKEY$
INPUT
INSTR
INT
INTEGER
INV
INVALID
ITERATE
JSB
JUSTIFY+
KEY
KILL
LBOUND
LEFT
LEFT$
LEN
LET
LF
LINE
LINES+
LINO
LINPUT
LIST
LOC
LOCKED
LOG
LOG10
LONG
LSET
MAG
MAGTAPE
MAP
MAR
MAR%
MARGIN
MAT
MAX
METAFILE+
MID
MID$
MIN
MIX+
MOD
MOD%
MODE
MODIFY
MOVE
MULTIPOINT+
NAME
NEXT
NO+
NOCHANGES
NODATA
NODUPLICATES
NOECHO
NOEXTEND
NOMARGIN
NONE
NOPAGE
NOREWIND
NOSPAN
NOT
NUL$
NUM
NUM$
NUM1$
NUM2
NX
NXEQ
OF
ON
ONECHR
ONERROR
OPEN
OPTION
OPTIONAL
OR
ORGANIZATION
OTHERWISE
OUTPUT
OVERFLOW
PAGE
PATH+
PEEK
PI
PICTURE
PLACE$
PLOT
POINT+
POINTS+
POS
POS%
PPS%
PRIMARY
PRIORITY+
PROD$
PROGRAM
PROMPT+
PUT
QUAD
QUO$
RAD$
RANDOM
RANDOMIZE
RANGE+
RCTRLC
RCTRLO
READ
REAL
RECORD
RECORDSIZE
RECORDTYPE
RECOUNT
REF
REGARDLESS
RELATIVE
REM
REMAP
RESET
RESTORE
RESUME
RETRY
RETURN
RFA
RIGHT
RIGHT$
RMSSTATUS
RND
ROTATE
ROUNDING
RSET
SCALE
SCRATCH
SEG$
SELECT
SEQUENTIAL
SET
SETUP
SEVERE
SFLOAT
SGN
SHEAR
SHIFT
SI
SIN
SINGLE
SIZE
SLEEP
SO
SP
SPACE+
SPACE$
SPAN
SPEC%
SQR
SQRT
STATUS
STEP
STOP
STR$
STREAM
STRING
STRING$
STYLE+
SUB
SUBEND
SUBEXIT
SUBSCRIPT
SUM$
SWAP%
SYS
TAB
TAN
TEMPORARY
TERMINAL
TEXT+
TFLOAT
THEN
TIM
TIME
TIME$
TO
TRAN+
TRANSFORM
TRANSFORMATION+
TRM$
TRN
TYP
TYPE
TYPE$
UBOUND
UNALIGNED
UNDEFINED
UNIT+
UNLESS
UNLOCK
UNTIL
UPDATE
USAGE$
USEROPEN
USING
USR$
VAL
VAL%
VALUE
VARIABLE
VARIANT
VFC
VIEWPORT+
VIRTUAL
VPS%
VT
WAIT
WARNING
WHEN
WHILE
WINDOW+)
WINDOWSIZE
WITH+
WORD
WRITE
XFLOAT
XLATE
XLATE$
XOR
ZER
+ Unreserved keyword+ Unreserved keyword |
This appendix describes:
I64 BASIC supports most of the Alpha BASIC features.
Differences are:
Table C-1 describes the VAX BASIC features not available in I64 BASIC/Alpha BASIC. There are no plans for I64 BASIC or Alpha BASIC to support these features.
Features | Comments |
---|---|
/[NO]ANSI_STANDARD | Enforces the ANSI Minimal BASIC standard. |
VAX BASIC Environment | The VAX BASIC Environment provides features specific to BASIC for program development. The RUN command and immediate mode are not supported. |
/[NO]SYNTAX_CHECK | Specifies syntax checking after every entered line. |
/[NO]FLAG=[BP2COMPATIBILITY] | Notifies VAX BASIC users of VAX BASIC features that are not compatible with PDP--11 BASIC/PLUS2. |
/[NO]FLAG=[AXPCOMPATIBILITY] | Notifies VAX BASIC users of VAX BASIC features that are not supported by I64 BASIC/Alpha BASIC. |
Graphics statements | Graphics statements, graphics transformation functions, and the information in Programming with VAX BASIC Graphics is not supported. |
HFLOAT data type | Specifies floating-point format for floating-point data. Additionally, the HFLOAT argument to the REAL built-in function is not supported. |
/[NO]DESIGN | There is no support for the Program Design Facility (PDF). The compiler does not attempt to compile a program when /DESIGN is specified. |
Table C-2 describes I64 BASIC/Alpha BASIC command-line qualifiers not available in VAX BASIC. For detailed information about all the BASIC qualifiers, see the HP BASIC for OpenVMS User Manual.
Qualifier | Comments |
---|---|
/INTEGER_SIZE=QUAD | Allows you to specify that integers should be quadwords (that is, 64 bits in size). |
/OPTIMIZE=LEVEL= n | Controls the level of optimization done by the compiler. (/OPTIMIZE without the LEVEL is available in VAX BASIC; see Section C.2.3.1.) |
/REAL_SIZE={SFLOAT | TFLOAT | XFLOAT} | Allows you to specify one of the IEEE floating-point data types, SFLOAT, TFLOAT, or XFLOAT. |
/SEPARATE_COMPILATION | Controls whether an individual compilation unit becomes a separate module in an object file. |
/SYNCHRONOUS_EXCEPTIONS | Controls whether or not the compiler emits additional code to emulate VAX BASIC exception behavior. |
/WARNINGS=ALIGNMENT | Instructs the compiler to flag all occurrences of non-naturally aligned RECORD fields, variables within COMMONs and MAPs, and RECORD arrays. |
This section describes the behavior differences between
I64 BASIC/Alpha BASIC and VAX BASIC.
C.2.3.1 Optimization
In both Alpha BASIC and VAX BASIC, the /[NO]OPTIMIZE qualifier controls whether optimization is turned on or off, and for both the default is /OPTIMIZE (unless /DEBUG is specified).
The difference is that Alpha BASIC allows you to specify which of
four levels of optimization the compiler should perform. The default is
/OPTIMIZE=LEVEL=4 (full optimization). In VAX BASIC, you cannot
specify a level of optimization. For more information, see the section
on BASIC command qualifiers in the HP BASIC for OpenVMS User Manual.
C.2.3.2 Data Types
The following data types are discussed in this section:
I64 BASIC/Alpha BASIC has four data types not available in VAX BASIC:
These four data types allow the Alpha BASIC user to take advantage
of the 64-bit Alpha architecture.
C.2.3.2.2 Implicit Use of the HFLOAT Data Type
VAX BASIC performs some intermediate calculations in the HFLOAT data type, even if the source code does not explicitly specify its use. This generally occurs when mixed data type operations are performed between large DECIMAL items and floating-point items.
Alpha BASIC performs these operations in GFLOAT. As a result, some loss of precision is possible. Alpha BASIC issues the following compile-time warning message if source code is encountered that results in this difference:
OPEPERGFL, operation performed in GFLOAT, loss of precision possible |
The Alpha hardware does not completely support the D-floating data type. Alpha BASIC performs BASIC DOUBLE operations (+, -, and so on) in G-floating (consistent with other languages on OpenVMS Alpha systems). As a result, the operations lose three bits of precision.
Alpha BASIC performs mixed operations between GFLOAT and DOUBLE in GFLOAT, not HFLOAT. VAX BASIC performs mixed operations between GFLOAT and DOUBLE in HFLOAT.
Conversions between the human world of decimal numbers and the binary
world of computers cause rounding errors. For example, .1 (1/10) cannot
be represented exactly in either D_floating or G_floating data type. It
must be rounded. Because the D_floating and G_floating representations
provide differing amounts of precision, the rounding error may be
slightly different. As a result, the D_floating and G_floating
representations of the same decimal number are not always the same when
converted back to decimal.
C.2.3.2.4 HFLOAT Data Type and HFLOAT COMPLEX Data Type in Oracle CDD/Repository
I64 BASIC/Alpha BASIC does not support HFLOAT. Neither I64 BASIC/Alpha BASIC nor VAX BASIC support the HFLOAT COMPLEX data type. The following sections discuss the translations that occur when reading records from Oracle CDD/Repository.
In I64 BASIC/Alpha BASIC, HFLOAT data types generate a GROUP using the name of the HFLOAT item specified in Oracle CDD/Repository. The GROUP contains a single 16 byte string item. Because HFLOAT is not supported, the compiler generates an informational message similiar to those caused by other unsupported data types.
See Example C-1 and Example C-2.
Example C-1 I64 BASIC / Alpha BASIC HFLOAT Translation |
---|
GROUP MY_H_REAL STRING STRING_VALUE = 16 END GROUP |
Example C-2 VAX BASIC HFLOAT Translation |
---|
HFLOAT MY_H_REAL |
In I64 BASIC/Alpha BASIC, the Oracle CDD/Repository data type HFLOAT COMPLEX maps to a GROUP of two 16-byte static strings. Example C-3 shows Oracle CDD/Repository output on I64 BASIC/Alpha BASIC.
Example C-3 Oracle CDD/Repository HFLOAT COMPLEX Data Type with I64 BASIC / Alpha BASIC |
---|
GROUP MY_H_COMPLEX STRING HFLOAT_R_VALUE = 16 STRING HFLOAT_I_VALUE = 16 END GROUP |
Example C-4 shows Oracle CDD/Repository output on VAX BASIC.
Example C-4 Oracle CDD/Repository HFLOAT COMPLEX Data Type with VAX BASIC |
---|
GROUP MY_H_COMPLEX HFLOAT HFLOAT_R_VALUE HFLOAT HFLOAT_I_VALUE END GROUP |
Both I64 BASIC/Alpha BASIC and VAX BASIC are able to pass
actual parameters by value, but only I64 BASIC/Alpha BASIC
allow by-value formal parameters.
C.2.3.4 Array Parameters
The following are differences in the way I64 BASIC/Alpha BASIC and VAX BASIC handle array parameters:
10 declare decimal(5,2) a(10) 20 call test_func(a()) 30 print a(1) 35 end 40 sub test_func(decimal(10,4) b()) 45 b(1) = 12.12 50 end sub |
10 record rec1 long a long b end record declare rec1 a(10) call test_func(a()) end 40 sub test_func(rec2 a()) record rec2 long x long y long z end record a(2)::x = 1 50 end sub |
In I64 BASIC/Alpha BASIC, DEF* routines cannot be called from within DEF routines or WHEN handlers. If such calls are attempted, the following error message is issued:
%BASIC-E-DEFSNOTALL, DEF* reference not allowed in DEF or handler |
I64 BASIC/Alpha BASIC gives highest precedence to DEF* routines that are called from within an expression. Thus, a DEF* routine call is evaluated first. When the DEF* routine directly modifies the values of variables used within the same expression, this can affect the result of the expression. If the compiler changes the order of a DEF* call in an expression, it issues the following warning message:
%BASIC-W-DEFEXPCOM, expression with DEF* too complex, moving <name> invocation |
You can avoid this by simplifying the expression.
C.2.3.6 /LINES Qualifier
In I64 BASIC/Alpha BASIC, the /LINES qualifier affects only the ERL function and determines whether BASIC line numbers are reported in run-time error messages. The following differences exist in I64 BASIC/Alpha BASIC:
VAX BASIC requires that source files using the plus sign (+) to append source files use line numbers within the files; otherwise, an error message is issued.
I64 BASIC/Alpha BASIC does not require line numbers in either
of the source files. The plus sign is treated as an OpenVMS append
operator. I64 BASIC/Alpha BASIC appends and compiles the
separate files as if they were a single source file.
C.2.3.8 Unreachable Code Error
I64 BASIC/Alpha BASIC performs extensive analysis when searching for unreachable code and may report more occurrences than VAX BASIC.
In I64 BASIC/Alpha BASIC, the compile-time error message for unreachable code, UNREACH, is an informational message. In VAX BASIC, the compile-time error message for unreachable code, INACOFOL, is a warning.
I64 BASIC/Alpha BASIC checks for DEF functions that are never referenced and issues the informational message "UNCALLED, routine xxxx can never be called."
Previous | Next | Contents | Index |