TTYGET statement

Syntax

TTYGET variable [FROM {file.variable | LPTR [n] | MTU [n] } ] 
{THEN statements [ELSE statements] | ELSE statements}

Description

Use the TTYGET statement to assign the characteristics of a terminal, line printer channel, or tape unit as a dynamic array to variable. If the FROM clause is omitted, a dynamic array of the terminal characteristics for your terminal is assigned to variable.

file.variable is a terminal opened for sequential processing with the OPENDEV statement or OPENSEQ statement. If file.variable is specified, the terminal characteristics for the specified terminal are retrieved.

n specifies a logical print channel with LPTR or a tape unit with MTU. (You cannot specify a tape unit on Windows.) If n is specified, the characteristics for the print channel or tape unit are retrieved. For logical print channels n is in the range of 0 through 225; the default is 0. For tape units n is in the range of 0 through 7; the default is 0.

If the terminal characteristics are retrieved, the THEN statements are executed.

If the device does not exist or cannot be opened, or if no dynamic array is returned, the ELSE statements are executed; any THEN statements are ignored.

If either file.variable or n evaluates to the null value, the TTYGET statement fails and the program terminates with a run-time error message.

The best way to access the information in the dynamic array is to include the BASIC code UNIVERSE.INCLUDE TTY. The syntax for including this file is:

$INCLUDE UNIVERSE.INCLUDE TTY

This file equates each value of the dynamic array to a name, so that each value can be easily accessed in your program. To take advantage of this code you must call variable tty$. Once this code has been included in your program, you can use the names to access the values of the dynamic array. To set values for a terminal line, use the TTYSET statement.

The following table lists the equate names to the values of the dynamic array, and describes each value. The final columns indicate which values are available on different operating systems: SV indicates System V, B indicates Berkeley UNIX, and NT indicates Windows.

Table 1. TTYGET Statement Values
Value Name Description Availability
      SV B NT
Field 1
1 mode.type One of these modes:

MODE$LINE or 0 = line

MODE$RAW or 1 = raw

MODE$CHAR or 2 = character

MODE$EMULATE or 3 = emulated

3 3 3 3 3 3 3 3 3 3
2 mode.min Minimum number of characters before input. 3 3 3
3 mode.time Minimum time in milliseconds before input. 3 3 3
Field 2
1 cc.intr Interrupt character. -1 undefined. 3 3 3
2 cc.quit Quit character. -1 undefined. 3 3  
3 cc.susp Suspend character. -1 undefined. 3 3  
4 cc.dsusp dsusp character. -1 undefined.   3  
5 cc.switch Switch character. -1 undefined. 3    
6 cc.erase erase character. -1 undefined. 3 3 3
7 cc.werase werase character. -1 undefined.   3  
8 cc.kill Kill character. -1 undefined. 3 3 3
9 cc.lnext lnext character. -1 undefined.   3  
10 cc.rprint rprint character. -1 undefined.   3 3
11 cc.eof eof character. -1 undefined. 3 3  
12 cc.eol eol character. -1 undefined. 3 3  
13 cc.eol2 eol2 character. -1 undefined. 3    
14 cc.flush Flush character. -1 undefined.   3  
15 cc.start Start character. -1 undefined. On System V, ^Q only. 3 3 3
16 cc.stop Stop character. -1 undefined. On System V, ^S only. 3 3 3
17 cc.lcont lcont character. -1 undefined. Emulated only. 3 3 3
18 cc.fmc fmc character. -1 undefined. Emulated only. 3 3 3
19 cc.vmc vmc character. -1 undefined. Emulated only. 3 3 3
20 cc.smc smc character. -1 undefined. Emulated only. 3 3 3
21 ccdel Delete character. 3 3  
Field 3
1 carrier.receive Terminal can receive data. 3 3 3
2 carrier.hangup Hang up upon close of terminal. 3 3  
3 carrier.local Terminal is a local line. 3 3 3
Field 4
1 case.ucin Convert lowercase to uppercase on input. 3 3  
2 case.ucout Convert lowercase to uppercase on output. 3 3  
3 case.xcase Uppercase is preceded by a backslash ( \ ) to distinguish it from lowercase. 3 3  
4 case.invert Invert case on input. Emulated only. 3 3 3
Field 5
1 crmode.inlcr Convert LINEFEED to RETURN on input. 3 3  
2 crmode.igncr Ignore RETURN on input. 3 3  
3 crmode.icrnl Convert RETURN to LINEFEED on input. 3 3  
4 crmode.onlcr Convert LINEFEED to LINEFEED, RETURN on output. 3 3  
5 crmode.ocrnl Convert RETURN to LINEFEED on output. 3 3  
6 crmode.onocr Prohibit output of RETURN when cursor is in column 0. 3 3  
7 crmode.onlret LINEFEED performs RETURN function. 3 3  
Field 6
1 delay.bs Set backspace delay. 3 3  
2 delay.cr Set RETURN delay. 3 3  
3 delay.ff Set formfeed delay. 3 3  
4 delay.lf Set LINEFEED delay. 3 3  
5 delay.vt Set vertical tab delay. 3 3  
6 delay.tab Set tab delay. 3 3  
7 delay.fill 0 = time delay 1 = fill with empty strings 2 = fill with DELETEs 3 3  
Field 7
1 echo.on Set terminal echo on. 3 3 3
2 echo.erase ECHOE$ERASE or 0 = print echo character

ECHOE$BS or 1 = echo as backspace

ECHOE$BSB or 2 = echo as backspace, space, backspace

ECHOE$PRINTER or 3 = echo as a printer

3 3  
3 echo.kill ECHOK$KILL or 0 = kill as kill character

ECHOK$LF or 1 = kill as RETURN, LINEFEED

ECHOK$ERASE or 2 = kill as series of erases

3 3  
4 echo.ctrl Set control to echo as ^ character 3 3  
5 echo.lf When echo is off, echo RETURN as RETURN, LINEFEED 3 3 3
Field 8
1 handshake.xon 1 = turns on X-ON/X-OFF protocol

0 = turns off X-ON/X-OFF protocol

3 3 3
2 handshake. startany 1 = any characters acts as X-ON

0 = only X-ON character acts as X-ON

3 3  
3 handshake. tandem 1 = when input buffer is nearly full, X-OFF is sent

0 = turns off automatic X-OFF, X-ON mode

3 3 3
4 handshake.dtr 1 = turns on DTR

0 = turns off DTR

3 3  
Field 9
1 output.post Output postprocessing occurs. 3 3  
2 output.tilde Special output processing for tilde. 3 3  
3 output.bg Stop background processes at output. 3 3  
4 output.cs Output clearscreen before reports. Emulated only. 3 3  
5 output.tab Set output tab expansion. 3 3  
Field 10
1 protocol.line Line protocol 3 3  
2 protocol.baud 1 = 50 9 = 1200

2 = 75 10 = 1800

3 = 110 11 = 2400

4 = 134 12 = 4800

5 = 150 13 = 9600

6 = 200 14 or EXTA = 19200

7 = 300 15 = EXTB

8 = 600

3 3 3
3 protocol.data Character size:

5 = 5 bits 7 = 7 bits

6 = 6 bits 8 = 8 bits

3 3 3
4 protocol.stop 2 = 2 stopbits 1 = 1 stopbit 3 3 3
5 protocol.output Output parity:

0 = no parity 1 = even parity

2 = odd parity

3 3 3 3 3 3 3
6 protocol.input Input parity:

0 = disable input parity checking

1 = enable input parity checking

2 = mark parity errors 3 = mark parity errors with a null 4 = ignore parity errors

3 3 3 3 3 3 3 3 3 3 3 3 3 3
7 protocol.strip 1 = strip to 7 bits 0 = 8 bits 3 3  
Field 11
1 signals.enable Enable signal keys: Interrupt, Suspend, Quit. 3 3  
2 signals.flush Flush type-ahead buffer. 3 3  
3 signals.brkkey 0 = break ignored

1 = break as interrupt

2 = break as null

3 3