Z313: Terminal Dialogue Routines

Author(s): J. Zoll Library: KERNLIB
Submitter: Submitted: 01.11.1994
Language: Fortran Revised:

These routines prompt the user on-line to the executing program for input from the terminal, and read it. The prompt is written to standard output by calling TMPRO, the input is read from standard input with TMREAD. Whether or not standard input is in fact a terminal can be detected with INTRAC (Z044); if it is not the call to TMPRO should be by-passed.

Structure:

SUBROUTINE subprograms
User Entry Names: TMINIT, TMPRO, TMREAD
Files references: standard input, standard output

Usage:

Initialize the dialogue
On some machines it is necessary to switch off buffered mode on standard output, this is done by calling once, and before the first call to TMPRO:

    CALL TMINIT (IFINIT)
 
        IFINIT*  is reset to non-zero by TMINIT
Put the prompt to standard output
    CALL TMPRO (TEXT)
 
          TEXT   is the character string to be written
Read next line from standard input
    CALL TMREAD (MAXCH, CHLINE, NCH, ISTAT)
 
         MAXCH   maximum number of char. to be stored into LINE
          LINE*  text read, of type CHARACTER
           NCH*  number of characters read into LINE
         ISTAT*  status returned:
                 = 0  success
                 < 0  end-of-file seen
                 > 0  read error
tex2html_wrap_inline57

Michel Goossens Wed Jun 5 10:27:02 METDST 1996