TTCHAR
Return type, lines, and width of a terminal
|
|
VSupported on OpenVMS
|
|
xcall TTCHAR(channel, [type], [lines], [width][, attributes])
Arguments
channel
The channel on which the terminal is open. (n)
type
(optional) A field containing a string that identifies the type of the terminal opened on channel. (a)
lines
(optional) The variable that will be loaded with the number of lines per screen page. (n)
width
(optional) The variable that will be loaded with the number of characters per line. (n)
attributes
(optional) The variable that will be loaded with the decimal codes of other terminal attributes. (a51)
Discussion
The TTCHAR subroutine returns the type, number of lines per page, number of characters per line, and other attributes of a terminal.
The terminal settings are obtained from the system when the channel is opened. If the terminal characteristics change while the channel is open, TTCHAR still returns the original information from when the channel was first opened. If the terminal characteristics are set improperly, TTCHAR returns incorrect information.
The following table indicates the position within the attributes argument of each code that TTCHAR returns. A value of one indicates the presence of the attribute. A value of zero indicates the attribute’s absence. See your OpenVMS I/O User’s Reference Manual for detailed information about the meaning of each attribute.
Attribute Positions in Attributes |
|||
---|---|---|---|
Attribute |
Position |
Attribute |
Position |
SCOPE |
1 |
TTSYNCH |
27 |
ANSICRT |
2 |
HALFDUP |
28 |
DECCRT |
3 |
XON |
29 |
AVO |
4 |
<reserved> |
30 |
BLOCK |
5 |
NOBRDCST |
31 |
EDIT |
6 |
BRDCSTMBX |
32 |
REGIS |
7 |
MBXDSABLE |
33 |
LOWER |
8 |
NOTYPEAHD |
34 |
WRAP |
9 |
ALTYPEAHD |
35 |
MECHFORM |
10 |
SETSPEED |
36 |
MECHTAB |
11 |
EDITING |
37 |
PASSALL |
12 |
INSERT |
38 |
EIGHTBIT |
13 |
FALLBACK |
39 |
CMA |
14 |
DIALUP |
40 |
NOECHO |
15 |
SECURE |
41 |
LOCALECHO |
16 |
DISCONNECT |
42 |
ESCAPE |
17 |
PASTHRU |
43 |
REMOTE |
18 |
SIXEL |
44 |
MODEM |
19 |
DRCS |
45 |
AUTOBAUD |
20 |
PRINTER |
46 |
HANGUP |
21 |
APP_KEYPAD |
47 |
MODHANGUP |
22 |
SYSPWD |
48 |
CRFILL |
23 |
TT_DECCRT2 |
49 |
LFFIL24 |
24 |
TT_DECCRT3 |
50 |
HOSTSYNC |
25 |
TT_DECCRT4 |
51 |
READSYNC |
26 |
|
|
Examples
The following example returns the type of terminal, along with the number of vertical lines and the width of each line on the terminal.
proc open(1, o, "tt:") xcall sho_term(1) end subroutine sho_term tt_ch ,d ;Terminal channel record term ,a30 ;Terminal type lines ,d3 ;Vertical lines for terminal width ,d3 ;Width of line buff ,a80 bufflen ,d2 proc xcall ttchar(tt_ch, term, lines, width) xcall s_bld(buff, bufflen, & "Your terminal is a %a, with %d lines of " + "%d characters", & term, lines, width) writes(tt_ch, buff(1:bufflen)) xreturn endsubroutine