next up previous index
Next: Index Up: CERNLIB Previous: Z312 VAX Tape

Z313 Terminal Dialogue Routines

Routine ID: Z313
Author(s): J. ZollLibrary: KERNLIB
Submitter: Submitted: 01.11.1994
Language: FortranRevised:

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



Janne Saarela
Mon Apr 3 15:06:23 METDST 1995