DataBasic is a significantly extended version of the original Dartmouth BASIC programming language and is the standard programming feature provided by Reality. It is an interactive, on-line, web-enabled, terminal-based language that includes all the main features of BASIC plus a range of additional features for the Reality environment. Web features include the RealWeb API, that generates web pages from data held in a Reality database; Remote Basic, that allows DataBasic routines to be called from Visual Basic and java, and as web services; and XML support, that allows DataBasic programmers to extract data from and export data to XML documents.
DataBasic programs are held as items in Reality files and are created by typing the program text (source code) into the item using any of the editors supplied with Reality (line Editor, Screen Editor or RealEdit). The source code is then compiled using the BASIC command, which creates either a deliverable or an executable item (or both) depending on the options selected. The deliverable item contains platform-independent code that can be copied to Reality databases on other types of host system without recompilation, while the executable item is platform-specific and can only be run on Reality databases on the same type of host system.
To execute the compiled program use the RUN command, specifying the name of the file containing the code and the name of the program; for example:
RUN PROGRAMS PROG
executes the program PROG that is in the file PROGRAMS.
If you prefer, you can use the
CATALOG command to create a copy of a
program which can be run from any account without using the RUN command. CATALOG creates a
command definition item in the
MD
of the account that points to the executable item – if no executable
item exists one is created. The program can then be executed from that account
by simply entering the program name at TCL; in the example above, for instance,
you would enter just PROG
instead of
RUN PROGRAMS PROG
.
You can copy the
command definition item into the MD of any account, making the program
available wherever it is needed.
Note: Depending on the options
used when you compiled your program, it may be necessary to also create a
In addition, cataloging reduces the time needed to execute a program (because if only a deliverable version is available, RUN must first convert it to an executable), saves memory space by reducing the number of copies of the executable code that are required, and simplifies creating synonyms for programs. External subroutines must be cataloged.