Functions and CALL Routines under OpenVMS |
Category: | Terminal-Access |
OpenVMS specifics: | All aspects are host-specific |
Syntax | |
Details | |
Example | |
See Also |
Syntax |
TTOPEN(control-specification,channel) |
is the control string that specifies the terminal and processing options, separated from each other by blanks. It can be a character variable, a character literal enclosed in double quotation marks, or another character expression. The value for control-specification gives the device name and processing options and has the following form:
DEVICE=name <processing-option-list> |
Each argument can be abbreviated to the shortest unique spelling. There is no default.
specifies the terminal name for subsequent I/O operations. DEVICE=name is required.
can be one or more of the following, separated by blanks:
If you specify BUFFERFULL as one of the processing options when you enumerate the control string for the TTOPEN function, input terminates when the buffer is full or when a terminating character (either the default character or the character set with the TERMINATOR processing option) is read.
The following list enumerates the effects on input termination when you turn on combinations of processing options:
causes input to be terminated when any of the following is true:
causes input to be terminated when any of the following is true:
causes input to be terminated when either of the following is true:
causes input to be terminated when either of the following is true:
causes input to be terminated when any of the following is true:
indicates whether data typed at the terminal is echoed on the monitor. If this attribute is not set, the behavior is based on the LOCALECHO characteristic for the terminal specified with DEVICE=. The following DCL command shows the characteristics for the terminal:
$ SHOW TERMINAL name
sets the size of the input buffer (that is, the number of characters that can be read at one time). The value can be no more than 200, the maximum size of a character variable in SAS. The default is 200 characters.
specifies the list of characters that are considered to be terminating characters for input. The hex-string consists of hexadecimal character pairs that correspond to the ASCII value of the characters used as terminators. Do not separate the digit pairs with delimiters such as commas or spaces.
If NOBUFFERFULL is in effect, the default terminator is a carriage return (hexadecimal value is 0D).
specifies how many seconds to wait for input from the terminal. If no input is received in the time specified, the operation fails with a time-out error. By default, there is no time limit and the input operation waits forever.
is a numeric variable into which the TTOPEN function places the channel number.
Details |
The channel that the TTOPEN function assigns is used by the other terminal-access functions to perform I/O to and from the terminal. If the TTOPEN function executes successfully, the return value is 0. Otherwise, the return value is the OpenVMS error code that indicates why it failed.
Example |
The following example reads up to 20 characters, discarding extra characters when the buffer is full and accepting either the carriage return or the horizontal tab character (hexadecimal value is 09) as terminators. If the read is successful, the program prints the string:
length string $ 20; rc=ttopen("dev=TT: size=20 term=0D09",chan); rc=ttread(chan,string,size); if size>0 & rc=0 then put string; rc=ttclose(chan);
See Also |
Copyright © 2009 by SAS Institute Inc., Cary, NC, USA. All rights reserved.