Pick For Professionals, Part 2: The TERM Command
by Jonathan E. Sisk
The TERM command is one of the most important commands in any well-versed TCL explorers' vocabulary. It defines the "window" in which any ACCESS report displays or prints. It is also vitally important to both the Update Processor and the TCL Command Stack. In this article, we will discuss the components of the TERM command and provide some inside techniques on how to deal with setting terminal and printer characteristics.
Each time you log on to a Pick System, you are automatically provided "default" terminal (and printer) characteristics. These are also sometimes referred to as "global" characteristics, as there can only be one setting for all terminals attached to the system. This unfortunately does not work adequately in most cases and virtually every licensee has added enhancements to the system to deal with the fact that systems tend to have a mixture of terminal and device types. We'll save this discussion until the end of the article and deal first with the basic operation of the TERM command.
When the TERM command is issued without any parameters (sometimes called "arguments"), the current terminal and printer "window" are displayed. Keep in mind that you can't change the characteristics for another terminal. Try this on your terminal:
:TERM
terminal name: MM-MON
product name: IBM VIDEO
terminal width: 79 printer width: 80
depth: 25 depth: 59
lineskip: 0
lf delay: 1
ff delay: 1
back space: 8
Note: this is the way the TERM command output appears on Advanced Pick Systems.
Here's how it looks on R-Series ("Generic" Pick) Systems:
>TERMTERMINAL PRINTER PAGE WIDTH: 79 132 PAGE DEPTH: 22 62 LINE SKIP: 1 LF DELAY: 0 FF DELAY: 2 BACKSPACE: 8 TERM TYPE: I
All you have done at this point is to simply interrogate your current settings. These settings may be altered to suit your own printing or display requirements. If you change any of the settings using the TERM command, the new settings will stay in place until you either log off or issue another TERM command with different arguments. Let's examine the components of the command:
The Page Width:
Note that there are two columns of output. The first numeric parameter in the leftmost column indicates the width of your CRT screen. Most screens can handle 80 characters on a line but there's a very good reason that the width is set to 79. If a character is displayed in the eightieth column position on a screen, an extra linefeed is sent out. This makes ACCESS reports appear to be double-spaced, and even worse, the first "half" of each page will scroll past without stopping.
The terminal page is usually only changed on CRT's that can handle a compressed display (usually 132 positions, but the width should be set to 131 for the same reason as before). Since the page width is the first of the arguments in the output, it must be the first numeric argument following the TERM command. As an experiment, set the terminal width to 40 as follows:
:TERM 40
Now, try a simple ACCESS report, such as:
:LIST MD
Note that the entire report is displayed within the 40 column positions. Use a
If you're naturally cautious, you may want to check the terminal characteristics after changing and before
issuing your next report. In the previous example where you changed the width of your CRT, nothing
displayed on the screen to indicate whether or not the operation was successful. A handy little option has been
lurking around the system for a while. Try this on your screen while you reset the width of your screen back to 79:
The R option is used to Re-display the changed settings. This prevents having to issue another TERM
command just to check it out.
This argument goes hand in hand with the page width. It defines the number of lines per page on the screen. It
varies depending on the type of terminal that you are using as to how many lines are available to display.
Changing the page depth is different than before, when you just changed the page width. Since the terminal
page depth is the second argument in the list, some provision must be made to prevent changing any of the
other current settings. The following example shows how to change just the terminal page depth:
If you are on an Advanced Pick platform, you just realized why it is so important to
have your terminal depth
set properly. The TCL Command Stack always wants the cursor at the lower left
corner of your screen. (We call this "bottom feeding".)
Even though the cursor may be lost somewhere in the middle of your screen, you
can re-issue the term command and get it back to its' normal state.
As an exercise, see if you can figure out
how to reset the page depth to its' original setting.
Since we didn't want to change the terminal width, the comma was inserted into
the list of arguments to indicate that we were changing only the second argument
and leaving the first one intact. Once again, test out
the resulting settings by issuing the command:
This parameter indicates the number of blank lines to output at the bottom of each screen or printer page. It is
usually set to 0 (zero). While you test changing this parameter, we'll reset the terminal page depth back to its
former setting:
If it's any consolation, the last of the PRISM-1's were sold to a small
shrimp boat fleet off the coast
of southern Florida where they are successfully being used as anchors.
These days, the terminals are fast
enough that they do not need to have ANY LF delay characters and
consequently, this parameter should be set to 0.
The Form Feed delay goes hand-in-hand with the LF delay, but has an extra added feature that can be
frustrating. It determines the number of delay characters sent between form feeds or clear screens.
When the FF delay is set to 2 (or higher), each ACCESS report directed to a printer or CRT will issue a form feed (clear screen) prior to starting output.
When the FF delay is set to 1, reports directed to the CRT will not clear the screen first, or even between pages of output, much like an old teletype terminal. This setting does not affect printer output, which still behaves the way it did when it was set at 2.
If the FF delay is set to 0, all form feeds and clear screens are suppressed, meaning that the printer will begin printing wherever the print head is
positioned.
The normal setting for FF delay is 2. Setting it at a higher setting results in sending out extra,
useless characters that simply slow down the system.
This is one of the fun things to play around with. Try this on for size: the backspace argument is the
DECIMAL value of the ASCII character to echo to the screen when the backspace key is pressed.
Have you ever studied one of the ASCII tables in the back of a manual or Pocket Guide?
Each ASCII character has both a decimal and hexadecimal (the counting system for propeller heads) equivalent.
Fortunately, there are only two possible choices for this setting: either 8 or 21.
For a little fun you can change it to a 7, which will make the backspace key beep every time it is pressed; or 12 to clear the screen. After you finish playing, don't forget to put this argument back to the way you found it.
The terminal type code is the setting that causes the most trouble.
Have you ever activated a screen or menu and have the entire screen print on one line?
No, this is not a new technique of conserving system resources,
nor is it likely to be a program bug (although that's always a possibility).
It's more likely that the terminal type code - the only alphabetic argument in the list - does not match the
CRT emulation being used.
Every CRT manufacturer builds their terminals a little differently.
When we program the terminal to produce
some effect, like clear the screen, or clear from the current cursor
position to the end of the line, a certain
sequence of characters, often called an "escape" sequence, must be directed to the CRT to accommodate the request.
Unfortunately, there are very few standards for these functions. What may work on a Wyse 50 might
throw a PC monitor into strange-display mode. Or vice-versa.
Consequently, it is critically important that the
term type setting match with the type of terminal that you are using. Unfortunately, there are very few
standards for these functions (sound familiar?). Each Pick licensee tends to add some codes, so here's a case of where you will have to dig out your system manuals to see which codes are supported on your system.
In Advanced Pick implementations, the device types are stored in the devices
file located in the dm account.
You can display the existing terminal type codes by issuing the command:
Here's a partial listing of what you might see:
Now, to add yet another level of complexity to this feature, today's CRT's have multiple "personalities".
Some, but not all, terminals can emulate other terminals. This can make life much easier when you have an off the wall brand terminal, like the new Anthrax 2000, which uses ancient druid chants for escape sequences, but in a pinch can emulate a Wyse-50.
As a consolation to the term type enigma, changing the term type is easy, again, because it is the only
alphabetic argument in the list. Here is the textbook rule about the term type argument:
The term type can appear anywhere in the list, but when it shares a position with a numeric argument it must be before the number.
Here are several valid examples:
Here is an invalid example:
This is invalid because the term type follows a number within the same set of commas.
Many Pick systems now include the software to define your own terminal type codes. For instance, in both Advanced Pick and the R-Series versions of Pick, there is a command in the dm (on AP) or SYSPROG (on R-Series) account called DEFINE-TERMINAL, which prompts you through the process.
You will need to dig out the manual that came with the terminal in order to answer the questions asked by the program.
The printer width behaves exactly like the terminal width discussed earlier in this article, but only affects
reports directed to the printer. One important thing to remember is that the printer width is the seventh
argument in the list, since the term type code doesn't count. For example, to change the printer width to 132 (for wide paper), you would issue the command:
(That's 6 commas before the new printer width argument.)
Two final thoughts on the printer width. Long ago, it was decided that the highest possible setting that would ever be needed for the printer width was 154. Nearly every modern printer has the ability to print in
"compressed" mode with the possibility of printing up to several hundred characters on a line. This is still a problem on most Pick systems as the TERM command will refuse the desired setting with the annoying
message:
[290] the range of the parameter "whatever" is not acceptable.
At least, it's not acceptable to some systems; others have removed this restriction.
Finally, if it's any consolation, PICK/BASIC ignores the 154-column boundary when printing on the printer.
That means that you can take advantage of compressed printing provided that
This is the partner of the printer width and is the eighth argument in the list. The printer depth is usually set to about six lines less than the number that are physically available on the paper. For instance, when printing on 11" paper at 6 lines per inch, there are 66 lines available to print on.
By setting the depth to 60 and adjusting the paper in the printer so that the print head is positioned a few lines down from the actual perforation you automatically get top and bottom margins. Here's an example of changing the printer depth:
The SET-TERM command has exactly the same behavioral characteristics as the TERM command, with one major difference. Rather than just affecting your own terminal/printer characteristics for the time that you are logged on, this updates the "default" table. That's why you have to use it from the dm or SYSPROG account.
This is how the table gets established to determine which characteristics to provide each time you log on.
Since this is a "one for all" kind of setting, it may not be appropriate for every terminal on your system. We usually set the default characteristics to fit the largest group of terminals. For instance, since we have more PC Monitors than dumb terminals, we set the default term type to mm-mon. The next section of this article discusses how most vendors have dealt with this inadequacy.
For example, in Generic Pick, there is a command called TERM-TYPE. When this command is issued, it reads in an item from the Dictionary level of the ACC file which contains the desired terminal characteristics. These settings are passed into a TERM command which puts them into play until you log off.
The mechanics of altering the terminal characteristics for use by TERM-TYPE are simple. First, you find out your port number, using the WHO command:
Next, you use this as the item-id in your edit command:
Using the R (to replace) command, you can change the terminal characteristics for your line. When you have completed your changes, use the "FI" command to file the item. By the way, attribute 1 of this item contains your "location" that appears in the LISTU command.
One final note, since most users are immediately whisked off into a menu when they sign on, it's important to include the TERM-TYPE command (or its equivalent on your system) in the logon PROC.
The mechanics of altering the terminal characteristics for use by TERM-TYPE are simple. First, you find out your port number, using the WHO command:
Note: Part 1 of this Series discusses the Update Processor.
If you don't know how to use it, you can simply press the [enter] or [return] key until you get down to the line labeled "device", and then change the characteristics. To file the item, use the Ctrl+xf command.
The alternate method is to use the conventional editor as described in the section prior to this one, but instead of the ACC file, using the PIBS file instead:
You can use the R (replace) command to change the terminal characteristics for your line. The ones you want to change are on attribute 2. Leave attribute 1 alone.
There is a program located in the dm account called "choose.term". This can be added to your users macro in the users file, using the Update Processor. This allows you to choose your terminal type code each time you log on, just in case you happen to log on from different types of devices from time to time.
In Advanced Pick implementations, the terminal type codes are both
single-character as well as fully spelled out device names. The R-Series
Pick implementations only support a single character as the term type.
This article was originally published in PICKWORLD Magazine.
A Useful TERM Command Option:
:TERM 79 (R)
The Page Depth:
:TERM ,12 (R)
:LIST MD
The Line Skip:
:TERM ,25,0 (R)
The LF Delay:
The LF delay is deeply rooted in history and remains in the system as homage to our ancestors. Remember that the Pick system has been around over 25 years. The earliest terminals,
the nefarious PRISM-1's from
Microdata, were SO SLOW (How slow were they?) that delay characters had to be
sent to the screen between
individual lines of output, simply to give the cursor time to scoot from the right
edge of the screen back to the
left edge.
The FF Delay:
The Backspace:
The TERM Type:
:sort only dm,devices,
a
ADDS580
ADM-11
ADM3A
AMPEX-D80
ampex.d80
ampex210
ansi
:TERM I (R)
:TERM MM-MON
:TERM ,,,,,,80,60,I
:TERM 79,ANSI25
:TERM 79I,22
The Printer Width:
>TERM ,,,,,,132 (R)
a) you are willing to write your reports in PICK/BASIC,
b) do not take advantage of the PICK/BASIC HEADING and/or FOOTING
statements and
c) don't try to get sneaky and EXECUTE an ACCESS report from PICK/BASIC thinking that maybe your system won't notice. It does.
The Printer Depth:
>TERM ,,,,,,,60 (R)
The SET-TERM Command:
Dealing With Different Types of Terminals:
Many licensees and software houses have taken the time to include a program that allows each terminal to be assigned their very own personalized terminal and printer characteristics each time you log on.
For R-Series Users:
:WHO
32 JES
:ED DICT ACC 32
For Advanced Pick Users:
:WHO
2 JES
Next, there are two methods of updating your characteristics: You can use the Update Processor as follows:
:U PIBS 2
:ED PIBS 2
top
.l2
001 79,24,mm-mon
002 79,25,,,2,mm-mon
One Final Option For Advanced Pick Users
