Introducing the Terminal Control Language

The Terminal Control Language (TCL) is the primary interface between the user and the mvBase system. It is a command processor.

When you enter a command line at the TCL prompt, TCL looks at the first word you type, and looks up the word in the Master Dictionary. If an entry is found, it identifies a system processor and control is passed to the processor. The system processor interprets the rest of the command line. As shown in next figure, TCL acts on user commands to invoke other system processors. Let’s look at a few simple commands.

The WHO command displays two pieces of useful information: the number of the user process associated with your terminal and the name of the account to which you are logged. To enter the WHO command, simply type WHO at the TCL prompt and then press ENTER:

>WHO

2 JOHN

WHO is the user’s input entered at the TCL prompt. 2 JOHN is the output returned by the command.

2 is the user process number. Each user process is identified by a unique number in a range from 0 to the maximum number of users supported on the system. JOHN is the name of the account. The user process number is independent of the account. If you log on to a different account from the same terminal, the account name would change, but the process number would be the same.

Many commands have optional parameters that modify the action of the command. The WHO command also has an optional * parameter that allows you to see this information for all users on the system. The following example shows a listing for all users currently logged on to a system.

>WHO

2 JOHN

 

>WHO *

0 JULIE

1 FRED

2 JOHN

3 STAFF

4 WALTER

5 LINDA

6 KATIE

7 UNKNOWN

8 UNKNOWN

9 UNKNOWN

10 UNKNOWN

11 UNKNOWN

12 UNKNOWN

13 UNKNOWN

14 UNKNOWN

15 UNKNOWN

The full output produced by WHO * advises that this system supports 16 users (0-15) and that only seven users are currently logged in. For instance, LINDA is on user process 5.

If you wanted to obtain a printout of this result, you could add the P option to the command line. This option is surrounded by parentheses.

>WHO * (P)

Instead of the listing appearing on the terminal screen, a message tells the user that the output has been sent to a printer.

Entering Commands

A TCL statement consists of a command, optional or required parameters, and options enclosed in parentheses:

Format

command [parameters] [(options[)]]

The figure above shows an example of these syntactical elements. The entire statement must be typed in uppercase characters. The statement is not interpreted until you press ENTER to submit it.

The command is the action word that initiates processing. The set of optional or required parameters are specific to the command. For instance, the COPY command, which is used to copy items in a file, takes two parameters: the name of a file followed by the name of an item.

COPY ORDERS 10118

COPY is the command, ORDERS is the name of the file defined in the account, and 10118 identifies an item in that file. When this command line is entered, the system responds with TO:, prompting the destination for the copy operation. Pressing ENTER at this prompt causes the item to be displayed on the screen.

Parenthetical options appear at the end of a command line and are surrounded by parentheses. Only the left parenthesis is required for the system to recognize the option:

COPY ORDERS 10118 (P

The P option can be used with any of the commands presented in this section to direct the output to the printer. Options are identified by a single alphabetic character or a single number or two numbers indicated as a range (n-m). Multiple options can be specified without spaces or delimiters between them, although you can separate options with commas. For a complete list of parenthetical options, see Using the Terminal Control Language.

Editing the Command Line

You can change what you have typed on the command line up until the time you press ENTER. The table below lists the control characters that are available for editing the command line.

CTRL+H

Backspaces over and deletes previous character. Same as BACKSPACE key.

CTRL+Q

Resumes the flow of output.

CTRL+R

Redisplays line. One use is during a communications session to see if garbage characters stemming from noisy telephone lines affected the TCL input line.

CTRL+S

Stops the flow of output.

CTRL+W

Backspaces over and deletes last word.

CTRL+X

Cancels and deletes entire command line.

CTRL+Y

Edits last command line on the stack.

CTRL+_

Line Continuation character permitting one command line to wrap across multiple lines. The Line Continuation character is used to break a long command line so that it can be typed on more than one physical line on the terminal screen. After typing CTRL+_ , you must press ENTER.

Paging

Some commands produce more output than can fit on a single screen. Normally the processor will display one page of output at a time and then pause. To see the next page of output, press any key. To exit instead of seeing the next page of output, press CTRL+X. It returns you to the TCL prompt. This is particularly useful to know when you are producing INFO/ACCESS reports on your terminal. If you find what you want in the first page, you can exit and ignore the rest of the output.

The parenthetical option N (NOPAGE) can be specified on the command line to disable paging. In other words, output to the terminal screen is continuous.

To control the flow of output, press CTRL+S to halt the output and CTRL+Q to resume output. CTRL+Q and CTRL+S send X-OFF and X-ON signals, respectively, to the communications line. The X-ON/X-OFF protocol must be enabled for your communications line for these control sequences to work. (The LIST-LINE-CHARS (LLC) command lists line settings for each line on the system. By default, X-ON/X-OFF is disabled. The PROTOCOL command can be used to change these settings.)

NOTE

CTRL+S and CTRL+Q do not work on the PC Console Port - Port 0.

The BREAK Key

While a system process is running, it remains in control of your terminal. Normally you want the system process to complete its work and return control to the TCL level. If you press BREAK while a process is running, you will suspend the process and drop into a debugger.

A debugger is used by programmers to examine the state of a program as it is executing. The mvBase system has two debuggers: the system debugger, identified by an exclamation mark (!) prompt, and the mvBASIC debugger, identified by an asterisk (*) prompt. If you break out of a program by accident, you can resume the execution of the process by typing G.

There are two other debugger commands that you might want to know. END terminates the suspended process and returns you to TCL. OFF logs you off the system. For instance, to exit to the TCL prompt from the system debugger, type END and press ENTER.

! END

 

>

 

CAUTION

Be extremely cautious in exiting a process because it might have been updating items in a file. Consult with your system administrator if you enter the debugger unexpectedly.

The BREAK key can be enabled or disabled using the DEBUG-ON and DEBUG-OFF commands, respectively; by default, it is enabled. In addition, it can be disabled by placing B in Attribute 9 of the Account Definition item.

See Also

Using User Accounts and Commands

Creating an Account

Logging On and Off

Introducing the TCL Stacker

The Master Dictionary

Examining Your Account

User Account Command Reference