# Compaq BASIC for OpenVMS
Alpha and VAX Systems
Reference Manual

Begin | Index

Contents (summary)
Preface | Preface
Chapter 1 | Program Elements and Structure
Chapter 2 | VAX BASIC Environment Commands
Chapter 3 | Compiler Directives
Chapter 4 | Statements and Functions
Appendix A | ASCII Character Codes
Appendix B | BASIC Keywords
Appendix C | Differences Between Alpha BASIC and VAX BASIC
| Index
| Figures
| Examples
| Tables

## Contents

Preface
Preface | Preface
Chapter 1
1 | Program Elements and Structure
1.1 | Components of Program Lines
1.1.1 | Line Numbers
1.1.1.1 | Programs with Line Numbers
1.1.1.2 | Programs Without Line Numbers
1.1.2 | Labels
1.1.3 | Statements
1.1.3.1 | Keywords
1.1.3.2 | Single-Statement Lines and Continued Statements
1.1.3.3 | Multistatement Lines
1.1.4 | Compiler Directives
1.2 | BASIC Character Set
1.3 | BASIC Data Types
1.3.1 | Implicit Data Typing
1.3.2 | Explicit Data Typing
1.3.3 | QUAD and IEEE Floating-Point Data Types
1.4 | Variables
1.4.1 | Variable Names
1.4.2 | Implicitly Declared Variables
1.4.3 | Explicitly Declared Variables
1.4.4 | Subscripted Variables and Arrays
1.4.5 | Initialization of Variables
1.5 | Constants
1.5.1 | Numeric Constants
1.5.1.1 | Floating-Point Constants
1.5.1.2 | Integer Constants
1.5.1.3 | Packed Decimal Constants
1.5.2 | String Constants
1.5.3 | Named Constants
1.5.3.1 | Naming Constants Within a Program Unit
1.5.3.2 | Naming Constants External to a Program Unit
1.5.4 | Explicit Literal Notation
1.5.5 | Predefined Constants
1.6 | Expressions
1.6.1 | Numeric Expressions
1.6.1.1 | Floating-Point and Integer Promotion Rules
1.6.1.2 | DECIMAL Promotion Rules
1.6.2 | String Expressions
1.6.3 | Conditional Expressions
1.6.3.1 | Numeric Relational Expressions
1.6.3.2 | String Relational Expressions
1.6.3.3 | Logical Expressions
1.6.4 | Evaluating Expressions
1.7 | Program Documentation
1.7.1 | Comment Fields
1.7.2 | REM Statements
Chapter 2
2 | VAX BASIC Environment Commands
Command 1 | ! Your-comment
Command 2 | $ System-command
Command 3 | APPEND
Command 4 | ASSIGN
Command 5 | COMPILE
Command 6 | CONTINUE
Command 7 | DELETE
Command 8 | EDIT
Command 9 | EXIT
Command 10 | HELP
Command 11 | IDENTIFY
Command 12 | INQUIRE
Command 13 | LIST and LISTNH
Command 14 | LOAD
Command 15 | LOCK
Command 16 | NEW
Command 17 | OLD
Command 18 | RENAME
Command 19 | REPLACE
Command 20 | RESEQUENCE
Command 21 | RUN and RUNNH
Command 22 | SAVE
Command 23 | SCALE
Command 24 | SCRATCH
Command 25 | SEQUENCE
Command 26 | SET
Command 27 | SHOW
Command 28 | UNSAVE
Chapter 3
3 | Compiler Directives
Command 29 | %ABORT
Command 30 | %CROSS
Command 31 | %DECLARED
Command 32 | %DEFINE
Command 33 | %IDENT
Command 34 | %IF-%THEN-%ELSE-%END %IF
Command 35 | %INCLUDE
Command 36 | %LET
Command 37 | %LIST
Command 38 | %NOCROSS
Command 39 | %NOLIST
Command 40 | %PAGE
Command 41 | %PRINT
Command 42 | %REPORT
Command 43 | %SBTTL
Command 44 | %TITLE
Command 45 | %UNDEFINE
Command 46 | %VARIANT
Chapter 4
4 | Statements and Functions
Command 47 | ABS
Command 48 | ABS%
Command 49 | ASCII
Command 50 | ATN
Command 51 | BUFSIZ
Command 52 | CALL
Command 53 | CAUSE ERROR
Command 54 | CCPOS
Command 55 | CHAIN
Command 56 | CHANGE
Command 57 | CHR$
Command 58 | CLOSE
Command 59 | COMMON
Command 60 | COMP%
Command 61 | CONTINUE
Command 62 | COS
Command 63 | CTRLC
Command 64 | CVT$$
Command 65 | CVTxx
Command 66 | DATA
Command 67 | DATE$
Command 68 | DATE4$
Command 69 | DECIMAL
Command 70 | DECLARE
Command 71 | DEF
Command 72 | DEF*
Command 73 | DELETE
Command 74 | DET
Command 75 | DIF$
Command 76 | DIMENSION
Command 77 | ECHO
Command 78 | EDIT$
Command 79 | END
Command 80 | ERL
Command 81 | ERN$
Command 82 | ERR
Command 83 | ERT$
Command 84 | EXIT
Command 85 | EXP
Command 86 | EXTERNAL
Command 87 | FIELD
Command 88 | FIND
Command 89 | FIX
Command 90 | FNEND
Command 91 | FNEXIT
Command 92 | FOR
Command 93 | FORMAT$
Command 94 | FREE
Command 95 | FSP$
Command 96 | FUNCTION
Command 97 | FUNCTIONEND
Command 98 | FUNCTIONEXIT
Command 99 | GET
Command 100 | GETRFA
Command 101 | GOSUB
Command 102 | GOTO
Command 103 | HANDLER
Command 104 | IF
Command 105 | INKEY$
Command 106 | INPUT
Command 107 | INPUT LINE
Command 108 | INSTR
Command 109 | INT
Command 110 | INTEGER
Command 111 | ITERATE
Command 112 | KILL
Command 113 | LBOUND
Command 114 | LEFT$
Command 115 | LEN
Command 116 | LET
Command 117 | LINPUT
Command 118 | LOC
Command 119 | LOG
Command 120 | LOG10
Command 121 | LSET
Command 122 | MAG
Command 123 | MAGTAPE
Command 124 | MAP
Command 125 | MAP DYNAMIC
Command 126 | MAR
Command 127 | MARGIN
Command 128 | MAT
Command 129 | MAT INPUT
Command 130 | MAT LINPUT
Command 131 | MAT PRINT
Command 132 | MAT READ
Command 133 | MAX
Command 134 | MID$
Command 135 | MIN
Command 136 | MOD
Command 137 | MOVE
Command 138 | NAME...AS
Command 139 | NEXT
Command 140 | NOECHO
Command 141 | NOMARGIN
Command 142 | NUM
Command 143 | NUM2
Command 144 | NUM$
Command 145 | NUM1$
Command 146 | ON ERROR GO BACK
Command 147 | ON ERROR GOTO
Command 148 | ON ERROR GOTO 0
Command 149 | ON...GOSUB
Command 150 | ON...GOTO
Command 151 | OPEN
Command 152 | OPTION
Command 153 | PLACE$
Command 154 | POS
Command 155 | PRINT
Command 156 | PRINT USING
Command 157 | PROD$
Command 158 | PROGRAM
Command 159 | PUT
Command 160 | QUO$
Command 161 | RAD$
Command 162 | RANDOMIZE
Command 163 | RCTRLC
Command 164 | RCTRLO
Command 165 | READ
Command 166 | REAL
Command 167 | RECORD
Command 168 | RECOUNT
Command 169 | REM
Command 170 | REMAP
Command 171 | RESET
Command 172 | RESTORE
Command 173 | RESUME
Command 174 | RETRY
Command 175 | RETURN
Command 176 | RIGHT$
Command 177 | RMSSTATUS
Command 178 | RND
Command 179 | RSET
Command 180 | SCRATCH
Command 181 | SEG$
Command 182 | SELECT
Command 183 | SET PROMPT
Command 184 | SGN
Command 185 | SIN
Command 186 | SLEEP
Command 187 | SPACE$
Command 188 | SQR
Command 189 | STATUS
Command 190 | STOP
Command 191 | STR$
Command 192 | STRING$
Command 193 | SUB
Command 194 | SUBEND
Command 195 | SUBEXIT
Command 196 | SUM$
Command 197 | SWAP%
Command 198 | TAB
Command 199 | TAN
Command 200 | TIME
Command 201 | TIME$
Command 202 | TRM$
Command 203 | UBOUND
Command 204 | UNLESS
Command 205 | UNLOCK
Command 206 | UNTIL
Command 207 | UPDATE
Command 208 | VAL
Command 209 | VAL%
Command 210 | VMSSTATUS
Command 211 | WAIT
Command 212 | WHEN ERROR
Command 213 | WHILE
Command 214 | XLATE$

Previous | Next | Contents | Index