Documentation Comments
Use this form to comment on this topic. You can also provide any general observations about the Online Documentation, or request that additional information be added in a future release.
Reality V15.0 ()
Using Alternative Compilers (DataBasic) (m6187ag_.htm)
In order to create program object items that will run on an earlier Northgate system, you need to use a different compiler from that provided by the default version of the BASIC command. This topic describes the compilers available and how to load and use them.
Alternative compilers are held in the file BASIC-COMPILERS. They create object items that will run on their target release, and on any equivalent or earlier release. However, they only recognise and compile DataBasic elements that are part of the subset defined for the target release.
There are two reasons why you might want to use an alternative compiler:
Code that compiled successfully on earlier versions of Reality fails to compile on the latest version. Ideally, you should correct the errors, but if this is not practical, you can compile with an earlier version of the compiler.
Note: An alternative to using an alternative compiler is to use the $OPTIONS statement to specify the required compiler version. This will produce code that behaves as if it was compiled using an earlier version of the compiler. Code compiled in this way can only be run on Reality V14.1 or later.
The following compilers are provided with Reality V15.0:
Compiler | Reality version |
---|---|
BASIC*15 (default) | V15.0 |
BASIC*14.2 | V14.2 |
BASIC*14.1 | V14.1 |
BASIC*14 | V14.0 |
BASIC*11 | V11.0, V12.0 |
BASIC*10 | V10.0 |
BASIC*09 | V9.1 |
BASIC*08 | V9.0 and earlier |
To use compilers other than the default, or to change the default, logon to the SYSPROG account and do the following:
If the compiler you need is not already loaded (the corresponding OPTOM item is not present in the default section of BASIC-COMPILERS), load it using the LOAD-BNFcommand as follows:
LOAD-BNF BASIC-COMPILERS,OPTOM compiler
DESTINATION FILE: BASIC-COMPILERS
where compiler is the item-id of the OPTOM item. For example, BASIC*REALITY*4.3 is suitable for compiling programs to run on systems with REALITY Release 1.2/4.3 (in fact, this compiler should also be used to compile for any earlier release).
Once the required compiler is loaded, you can run it as follows:
For frequent use, create a new command to run it. To do this, copy the BASIC MD item to a new item with a suitable name (such as OLD-BASIC). Modify attribute 1 of this item to change the 'tag' (the character B) to some other single character (not G, O, or Q). For example, change attribute 1 from PB to PX. Now create an item in BASIC-COMPILERS with the new tag as its item-id, Q as attribute 1, and the item-id of the loaded compiler item in attribute 2. For example:
X
001 Q
002 BASIC*REALITY*4.3
You can now use the new command to compile using the selected compiler.
For infrequent use, use the BASIC command with option C. See below for a description of syntax and prompts.
Note: If you are using Procs or programs to drive multiple compilers, you should also use BASIC with option C so that you can specify exactly which compiler will be used.
To change the default compiler for the database or system, edit item BASIC*DEFAULT in BASIC-COMPILERS to replace the contents of attribute 2 with the item-id of the loaded compiler item required. The standard BASIC command will then call that compiler.
To use an alternative DataBasic compiler, enter the BASIC command with the C option as shown below:
BASIC file-name prog-name (C
file-name The name of the file that contains the program you want to compile.
prog-name The name of the program you want to compile.
(C Prompt for the compiler name.
At the prompt
Compiler name :
enter the name of the compiler you want to use. The names of the compilers are listed in the BASIC-COMPILERS file. For example, at the Compiler name prompt, enter:
BASIC*REALITY*4.3 for systems on Reality 4.3
BASIC*SPIRIT*2.2 for SPIRIT 2.2 systems