C-------------------------------------------------------------------C
C  Directory Management        January 1983                         C
C  Written by John C. Hayre, Texas Instruments                      C
C  Send suggestions and/or complaints to:                           C
C                                                                   C
C               Veeco Integrated Automation			    C
C               10355 Brockwood Rd				    C
C               Dallas, Texas 75238                                 C
C               (Attention John Hayre)                              C
C                                                                   C
C  Phone: 214-349-8482                                              C
C-------------------------------------------------------------------C
C Routine to empty read ahead buffer from the VT100 Crt.            C
C-------------------------------------------------------------------C
       Subroutine purgechar 
       Implicit Integer*4 (A - Z)
       Character*1 X
       Integer*2 IOSB(4)
       Integer*2 TTCh1
       External IO$M_Noecho,IO$_Readvblk,IO$M_Purge
       COMMON /TTCH/ TTCH1
C-------------------------------------------------------------------C

       F1 = %loc(Io$_Readvblk) .OR. %Loc(Io$M_Noecho)
     1 + %loc(io$m_purge)
       Stat = Sys$Qiow(%Val(3),%Val(TTCh1),%Val(F1),%Ref(IOSB),
     1 ,,%Ref(X),%Val(0),,%Ref(Termch),,)
       If (.not. Stat) Call Lib$Stop(%Val(Stat))
       If (.not. IOSB(1)) Call Lib$Stop(%Val(IOSB(1)))
       Return
       End
