C-----------------------------------------------------------------------
C  URDTTY -- INSERT LINE OF TEXT IN APPLICATION TTY INPUT STREAM
C     THIS LINE OF TEXT WILL BE TAKEN AS IF TYPED IN BY THE USER, AND
C     WILL BE ECHOED OUT TO THE OUTPUT SCRIPT FILE IF AN OUTPUT SCRIPT
C     FILE IS OPEN
C
      SUBROUTINE URDTTY(ZSTR)
C
      CHARACTER*(*) ZSTR
C
      INCLUDE 'USERIO'
C
C----------------------------------------
C
      IF(NPRBUF.EQ.0) LPRBUF=0
C
      NPRBUF=NPRBUF+1
      LPRBUF=LPRBUF+1
C
      PREBUF(LPRBUF)=ZSTR
C
      ILENZ=LEN(ZSTR)
      ILENP=LEN(PREBUF(LPRBUF))
C
      IF(ILENZ.GT.ILENP) THEN
        CALL UERMSG(
     >      '?URDTTY -- INPUT STRING TRUNCATED',PREBUF(LPRBUF),0)
      ENDIF
C
C  CHECK OUTPUT FLAG
      CALL URXOUT
C
      RETURN
      END
