This topic introduces the Terminal Command Language, describing:
It contains a list of general user commands that are not described elsewhere in the Reality documentation and provides a detailed description of each. Included are TCL commands for:
The Terminal Control Language (TCL) is the primary interface between database users and Reality processors. Processors are executed by typing a command input statement at the TCL colon prompt (:) and pressing the return key.
Note: If you are running the evaluation version of Reality, the TCL colon prompt will be prefixed by the text “Eval”.
The following types of TCL command are supported by Reality:
TCL commands available for use in an account are defined by command definition items in the account's Master Dictionary (MD). The item-id of a command definition item is the name of the command it defines. The first attribute of the definition item specifies the type of command. Proc definition items contain PQ or PQN in attribute 1. All other command definition items have P or V as the first character in attribute 1. Some have a second character that defines special functions that have to be performed by Reality software for that particular command.
A synonym command definition item is identified by a V in attribute 1. A synonym definition item can be created by the user to reference a standard command definition item, providing an alternative name that can be entered at TCL to execute the command. The synonym item-id chosen must be unique within the MD. With V in the first attribute, the second attribute contains the item-id of the referenced command.
The topic Command Definition Items details all types of command definition items.
The command input statement entered at the TCL colon prompt must begin with a command name which matches the item-id of one of the command types listed previously. Each input statement can include several lines of parameters, but only one command name. The statement is processed by TCL after return is pressed. When processing is complete, Reality re-displays the TCL colon prompt.
The TCL processor analyses an input statement as follows:
It looks up the first word of the input statement in first the command definition item-ids in the MD and then the commands in the alternate verbs file. If the word is not found, it displays the following error message:
command IS NOT A VERB
In general, the TCL processor is sensitive to the case of commands you enter. However, if the command cannot be found and the first character is in lower case, the entire command line except for any quoted strings is converted to upper case and the search is repeated. For example, if you enter
edelete test "$testitem"
this will be converted to
EDELETE TEST "$testitem"
Notes:
To convert a complete command, including any quoted strings, to upper case, enter the TCL stacker and use the MU Editor command. Then re-execute the modified command. For example:
:edelete test "$testitem" '$testitem' not on file. [430] No items deleted. :. Top 001 edelete test "$testitem" .MU 001 EDELETE TEST "$TESTITEM" .FI :EDELETE TEST "$TESTITEM" 1 Items deleted. :
When you are typing characters in response to the TCL prompt, the system allows you to enter up to 240 characters before it performs an automatic linefeed. However, you can extend a line by pressing a line continuation key combination.
To specify line continuation, hold down the ctrl key and press the underscore key (_); this may require you to hold down the shift key as well as CTRL. Then press the return key.
Note: If a space is required at the line continuation, this must be included as if the line continuation had not been entered.
command {parameter}... {(options}
where:
command specifies the operation.
parameter is required for some TCL-I commands.
Most TCL-I commands either allow no options or allow only the following:
H Heading. Suppresses default heading line.
N No Page. Inhibits automatic pause at end of screen.
P Print. Sends output to the Spooler.
Examples of TCL-I commands are ADDX, BLOCK-PRINT and LISTVERBS.
TCL-II commands execute the
command file-specifier item-list {(options}
where:
command Specifies the operation.
file-specifier Specifies the file to be processed. For details, see General Conventions.
item-list One or more item-ids separated by spaces. If an item-id contains embedded blanks or parentheses, it must be surrounded by single or double quotes.
To specify all the items in a file, enter an asterisk (*) for the item-list.
You can also use an active select list instead of an
item list. This is supplied by a command that generates a select list executed
immediately before the
If you do not provide any type of item list, the processor prompts you for one.
Unless otherwise noted,
N No Page. Inhibits automatic pause at end of screen.
P Print. Sends output to the Spooler.
Several options can be specified at the same time. For
example, (IP
.
Examples of
English commands are entered at TCL, but control is passed to the English processor for the command to be executed. An English input statement consists of a command and a file specifier followed by a number of optional clauses. Generally, the clauses can be entered in any sequence. For detailed information on constructing an English input statement, refer to the The English Sentence.
TCL and English commands can be used in conjunction with list-generating commands. These commands generate a select list that can be used to supply an item list to an immediately following TCL-II or English command. Alternatively, the list can be saved via SAVE-LIST or NEW-SAVE-LIST for later retrieval via the GET-LIST or NEW-GET-LIST command respectively.
The active Select list is indicated by a change from the usual TCL prompt, the colon (:), to the select prompt, the 'greater than' (>) symbol. The next command you enter at this new prompt uses the active list.
For example, to copy all of the items in the file BP that begin with the letter B to another file called NEWBP, type the following:
:SELECT BP = 'B]'
26 ITEMS SELECTED. >COPY BP
TO:(NEWBP
26 ITEMS COPIED
Other commands that enable lists to be managed are listed in List Processing Commands.
Commands that are cataloged DataBasic programs are executed
by entering the name of the program at the TCL prompt (:
). The syntax
will depend on the program.
A compiled program is cataloged using the CATALOG command; this loads the program object item into a system file called POINTER-FILE and creates a command definition item in the MD of the account in which the program is cataloged. The command definition item points to the object item. For more information, refer to Introduction to DataBasic.
These commands are executed by
typing the name of the Proc at the TCL prompt (:
). The syntax will
depend on the Proc. Some system commands are Procs.
Proc commands have the code PQ or PQN in attribute one of their Proc definition items. You can create new commands by writing your own Procs.
When creating new Proc commands two conventions should be observed.
For more information, refer to the Proc Reference.