The Compaq Language-Sensitive Editor for OpenVMS Systems is a source code editor that allows you to quickly and accurately develop programs. Using the Editor commands, you can control the editing environment and access the Editor's knowledge of BASIC. A series of tokens can be expanded on your screen to create a syntactically correct BASIC program.
1 – Compilation unit
A compilation unit is a block of code that can be compiled as a unit. The compilation unit is the initial token displayed on your screen by the Language-Sensitive Editor. Before you start your editing session, you must select the type of program unit you plan to edit. BASIC compilation units include PROGRAM units, and SUB and FUNCTION subprograms.
1.1 – PROGRAM unit
A main program unit can be compiled, linked, and executed by itself, whereas a SUB or FUNCTION program unit cannot be executed unless it is linked with a main program unit. A main program unit can be delimited with the PROGRAM and END PROGRAM statements; however, these statements are optional.
1.2 – SUB program unit
A SUB subprogram cannot be executed unless linked with a main program unit. A SUB subprogram does not return a value except by way of a modifiable parameter (passed BY REF or BY DESC). SUB subprograms are called from the main program with the CALL statement. The SUB statement marks the beginning of a SUB subprogram and specifies its parameters by number and data type.
1.3 – FUNCTION program unit
A FUNCTION subprogram cannot be executed unless linked with a main program unit. Unlike SUB subprograms, FUNCTION subprograms return a value. FUNCTION subprograms are called from the main program by referencing the FUNCTION name. FUNCTION subprograms must be declared with the EXTERNAL statement in the main program. You must specify the data type for the function in both the main program EXTERNAL statement and the subprogram FUNCTION statement. The FUNCTION statement marks the beginning of a FUNCTION Subprogram and defines the subprogram's parameters.
2 – Statement
The statement token can be expanded to display any valid BASIC statement. The statement token is available in all of the compilation units and can be repeated as often as you wish. When you call the Language-Sensitive Editor to modify a program unit already in existence, the statement token is not available. However, you can enter the beginning of any valid BASIC statement and then expand it with the editor in the usual way.
3 – Program header
The program_header token is useful for documenting your program. Placeholders are provided for listing the program author and title. Compiler directives are available for controlling the listing file. In the program_header, you can explain program features such as labels, supplied inputs, and any side effects.
4 – Declarations
The declaration section provides you with placeholders to declare external and local constants, external routines, local functions, RECORDs, MAPs, COMMONs, and any variables.
5 – Handler statements
Handler_statements such as RETRY, CONTINUE, and EXIT HANDLER are only valid inside an attached or detached handler.