Compaq BASIC for OpenVMS
Alpha and VAX Systems
User Manual


Previous Contents Index

B.3 Errors Not Generated by BASIC

Table B-2 contains errors that cannot be generated in BASIC. However, they can be displayed with the ERT$ function and are included for completeness.

Table B-2 Errors Not Generated by BASIC
Number Text
3 ?Account or device in use
6 ?Not a valid device
8 ?Device not available
13 ?User data error on device
16 ?Name or account now exists
17 ?Too many open files on unit
19 ?Disk block is interlocked
20 ?Pack ids don't match
21 ?Disk pack is not mounted
22 ?Disk pack is locked out
23 ?Illegal cluster size
24 ?Disk pack is private
25 ?Disk pack needs 'cleaning'
26 ?Fatal disk pack mount error
27 ?I/O to detached keyboard
30 ?Device not file-structured
32 ?No buffer space available
33 ?Odd address trap
34 ?Reserved instruction trap
36 ?SP stack overflow
37 ?Disk error during swap
38 ?Memory parity (or ECC) failure
39 ?Magtape select error
40 ?Magtape record length error
41 ?Non-res run-time system
44 ?Matrix or array too big
47 ?Line too long
60 ?Integer overflow, FOR loop
62 ?No run-time system
65 ?Illegal MAGTAPE( ) usage
68-70 unused
71 ?Statement not found
74 ?Undefined function called
75 ?Illegal symbol
76 ?Illegal verb
77 ?Illegal expression
78 ?Illegal mode mixing
79 ?Illegal IF statement
80 ?Illegal conditional clause
81 ?Illegal function name
82 ?Illegal dummy variable
83 ?Illegal FN redefinition
84 ?Illegal line number(s)
85 ?Modifier error
86 ?Can't compile statement
87 ?Expression too complicated
90 %Inconsistent function usage
91 ?Illegal DEF nesting
92 ?FOR without NEXT
93 ?NEXT without FOR
94 ?DEF without FNEND
95 ?FNEND without DEF
96 ?Literal string needed
98 ?Syntax error
99 ?String is needed
100 ?Number is needed
106 %Inconsistent subscript use
107 ?ON statement needs GOTO
108 ?End of statement not seen
109 ?What?
110 ?Bad line number pair
111 ?Not enough available memory
112 ?Execute only file
113 ?Please use the run command
114 ?Can't CONTinue
115 ?File exists-RENAME/REPLACE
117 ?Matrix or array without DIM
118 ?Bad number in PRINT USING
119 ?Illegal in immediate mode
120 ?PRINT-USING buffer overflow
121 ?Illegal statement
125 ?Wrong math package
135 ?Illegal usage
140 ?Index not initialized
163 ?No file name
165 ?Cannot position to EOF
167 ?Illegal record format
169 unused
172 ?Record lock failed
180 ?No support for operation in task
182 ?Network operation rejected
184 ?Unaligned REMAP variable
188 ?UNLOCK EXPLICIT requires RECORDSIZE 512
198-225 unused
230 ?No fields in image
231 ?Illegal string image
232 ?Null image
233 ?Illegal numeric image
234 ?Numeric image for string
235 ?String image for numeric
236 ?TIME limit exceeded
237 ?First arg to SEG$ greater than second
241 ?Floating overflow
242 ?Floating underflow
243 ?CHAIN to nonexistent line number
244 ?Exponentiation error
248 ?Illegal return from subroutine
249 ?Argument out of bounds
251 ?Recursive subroutine call
254-255 unused
294-300 unused


Appendix C
Optional Programming Productivity Tools

This appendix provides an overview of optional programming productivity tools. These tools are not included with the BASIC software; they must be purchased separately. Using these tools can increase your productivity as a BASIC programmer. The following products are briefly described in this appendix:

For more information on using these tools, see the listed documentation at the end of each section.

For information about how to purchase these tools, contact your Compaq sales representative.

C.1 Language Sensitive Editor (LSE) and Source Code Analyzer (SCA)

The Compaq Language Sensitive Editor for OpenVMS (LSE) and the Compaq Source Code Analyzer for OpenVMS (SCA) must be purchased separately. LSE is a powerful and flexible text editor designed specifically for software development. LSE has important features that help you produce syntactically correct code in BASIC. SCA is an interactive tool that is used to perform program analysis.

LSE and SCA are closely integrated products; generally, SCA can be invoked through LSE. LSE provides additional editing features that make SCA program analysis more efficient. In addition, LSE and SCA, in conjunction with the BASIC compiler, provide a set of new enhancements supporting source code designing and review.

For more information about LSE and SCA, see the Guide to Language-Sensitive Editor for VMS Systems and Guide to Source Code Analyzer for VMS Systems.

C.1.1 Preparing an SCA Library

SCA stores data generated by the BASIC compiler in an SCA library. The data in the SCA library contains information about all symbols, modules, and files encountered during a specific compilation of the source.

After creating and initializing the OpenVMS directory of the SCA library, direct the BASIC compiler to generate data analysis files by appending the /ANALYSIS_DATA qualifier to the BASIC command as follows:


$ BASIC/ANALYSIS_DATA PG1,PG2,PG3

This command line compiles the input files PG1.BAS, PG2.BAS, and PG3.BAS, and generates corresponding output files for each input file with the file types OBJ and ANA. SCA puts these files in your current default directory.

Load the information in the data analysis files into your SCA library with the LOAD command as follows:


$ SCA LOAD PG1,PG2,PG3

This command loads your library with the modules contained in the data analysis files PG1.ANA, PG2.ANA, and PG3.ANA.

After the SCA library has been prepared, enter LSE to begin an SCA session. Within this context, the integration of LSE and SCA provides commands that can be used only within LSE.

C.1.2 Compiling from within LSE

To compile a completed BASIC program, enter the following command at the LSE prompt:


LSE> COMPILE

To compile a BASIC program that contains placeholders and design comments, include the following qualifiers to the previous command:


LSE> COMPILE $/ANALYSIS_DATA/DESIGN=(PLACEHOLDERS, COMMENTS)

The /ANALYSIS_DATA qualifier causes the compiler to generate an analysis data file containing source code analysis information. This information is provided to the SCA library.

The /DESIGN qualifier instructs the BASIC compiler to recognize placeholders and design comments as valid program elements. If the /ANALYSIS_DATA qualifier has also been specified, the BASIC compiler includes information on placeholders and design comments in the analysis data file.

C.1.3 BASIC Support for LSE and SCA Features

This section describes information specific to BASIC for the following LSE and SCA features:

C.1.3.1 Programming Language Placeholders and Tokens

LSE accepts keywords, or tokens, for all languages with LSE support. However, the specific tokens themselves are language defined. For example, you can expand the [MAT] token only when using BASIC.

Likewise, LSE provides placeholders, or prompt markers, for all languages with LSE support. However, as with tokens, the specific text or choices these markers call for are language defined. For example, you see the [record-declarations] placeholder only when using BASIC.

Note

Keywords such as TYPE, VARIANT, IF, FOR, and OPEN, can be tokens as well as placeholders. Therefore, any time you are in LSE with the language set to BASIC, you can type one of these words and press Ctrl/E to expand the construct.

Remember that braces ({}) enclose required placeholders and brackets ([]) enclose optional placeholders. Note that when you erase an optional placeholder, LSE also deletes any associated text before and after that placeholder.

You can use the SHOW TOKEN and SHOW PLACEHOLDER commands to display a list of all BASIC tokens and placeholders, or a particular token or placeholder. For example:


LSE> SHOW TOKEN IF              {lists the token IF} 
LSE> SHOW TOKEN                 {lists all tokens} 

To copy the listed information into a separate file, first enter the appropriate SHOW command to put the list into the $SHOW buffer. Next, enter the following command:


LSE> GOTO BUFFER $SHOW 
LSE> WRITE filename.filetype

To obtain a hard copy of the list, use the PRINT command at DCL level to print the file you created.

C.1.3.2 Placeholder and Design Comment Processing

While all languages with Version 3.0 of LSE support provide placeholder processing, each language defines specific contexts in which placeholders can be accepted as valid program code. The following list contains valid contexts in which placeholder processing is allowed:

BASIC accepts optional LSE placeholders in any context where optional syntax is allowed. Example C-1 shows several contexts in which LSE placeholders and design comments might appear in the design of a BASIC program.

Example C-1 LSE Placeholders in a BASIC Program

!++ 
!   FUNCTIONAL DESCRIPTION: 
! 
!     This procedure computes the amount of an employee's salary and prints 
!     a paycheck.     
! 
!   FORMAL PARAMETERS: 
! 
!     name - 
!         The name of the employee, last name first. 
! 
! 
! 
!-- 
    DECLARE INTEGER weekly_salary 
 
    <<Fetch the employee's record.>>; 
 
!+ 
!     Compute paychecks differently for salaried and hourly employees. 
!- 
     If <<employee is salaried>> 
     THEN 
        <<Use a fixed weekly salary from the employee's record.>> 
     ELSE 
        <<Fetch the number of regular and overtime hours worked.>>; 
        <<Compute the weekly pay.>> 
     END IF; 
 
     <<Print the paycheck>> 
     END SUBPROGRAM paycheck 

BASIC support for placeholder and design comment processing includes the following language-specific stipulations:

Placeholders can be either required or optional. Required placeholders, which are delimited by braces ({}), represent places in the source code where you must provide program text. Optional placeholders, which are delimited by brackets ([]), represent places in the source code where you can either provide additional constructs or delete the placeholder.

Additionally, when you use BASIC with LSE, the expanded code might include ellispes (...) or vertical bars (|). Syntax constructs followed by ellipses indicate that the constructs can be repeated. A vertical bar between constructs indicates that you must choose one of the constructs.

Table C-1 lists the three types of LSE placeholders.

Table C-1 Types of LSE Placeholders
Type of Placeholder Description
Terminal Provides text strings that describe valid replacements for the placeholder
Nonterminal Expands into additional language constructs
Menu Provides a list of options corresponding to the placeholder

LSE commands allow you to manipulate tokens and placeholders. These commands and their default key bindings are listed in Table C-2.

Table C-2 LSE Commands Used to Manipulate Tokens and Placeholders
Command Key Binding Function
EXPAND Ctrl/E Expands a placeholder
UNEXPAND PF1 Ctrl/E Reverses the effect of the most recent placeholder expansion
GOTO PLACEHOLDER/FORWARD Ctrl/N Moves the cursor to the next placeholder
GOTO PLACEHOLDER/REVERSE Ctrl/P Moves the cursor to the previous placeholder
ERASE PLACEHOLDER/FORWARD Ctrl/K Erases a placeholder
UNERASE PLACEHOLDER PF1 Ctrl/K Restores the most recently erased placeholder
None Down arrow Moves the indicator down through a menu
None Up arrow Moves the indicator up through a menu
None
  • ENTER
  • RETURN
Selects a menu option

C.2 CDD/Repository

BASIC supports CDD/Repository. The current version of CDD/Repository is compatible with previous versions of CDD.

See Chapter 22 for more information about CDD/Repository.

C.3 Database Management System (DBMS)

DBMS is a multiuser, general-purpose, CODASYL-compliant database management system. DBMS is used for accessing and administrating databases ranging in complexity from simple hierarchies to complex networks with multilevel relationships. DBMS supports full concurrent access in a multiuser environment without compromising the integrity and security of your database.

For more information, see the DBMS documentation.


Previous Next Contents Index