TY.ERR - handle error in terminal input.

Alternate Entry Name: TY_ERR

Usage:

B:
   ty.err(readunit, format [, a1, a2, ...]);
C:
   void ty_err(FILE *readunit, const char *format, ...);

Where:

readunit
is the unit being read when the error occurs.
format, a1, a2..
is a PRINTF type argument list, used to build an error message for the user.

Description:

TY.ERR is called from a program that expects interactive input when an error is detected. It is intended to clear the terminal input buffer of all pending input so that the next read will obtain the user's reply to the error message.

"Format" and the arguments following it are passed to PRINTF to write an error message to the user (unit -4).

If "readunit" is currently the user's terminal input unit, the terminal input buffer is flushed. If "readunit" is not the terminal (as might be the case if standard input was redirected), TY.ERR terminates the program. If the user is in a CRUN, TY.ERR will normally terminate the program; however, if the user is simply using the CRUN "$*$talk" mode, TY.ERR will NOT automatically terminate the program.

Copyright © 1996, Thinkage Ltd.