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 input a chacter with no echo from the VT100 Crt.       C
C-------------------------------------------------------------------C
       Subroutine Get1Char(X, Pur)
       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)

       Stat = Sys$Qiow(%Val(3),%Val(TTCh1),%Val(F1),%Ref(IOSB),
     1 ,,%Ref(X),%Val(1),,%Ref(Termch),,)
       If (.not. Stat) Call Lib$Stop(%Val(Stat))
       If (.not. IOSB(1)) Call Lib$Stop(%Val(IOSB(1)))
       Return
       End


C-------------------------------------------------------------------C
C Routine to input a chacter with no echo from the VT100 Crt and get
C the clock to tick.
C-------------------------------------------------------------------C
	Subroutine Get1Char_and_clock_tick(X, Purge)
	Implicit Integer*4 (A - Z)
	Character*1 X
	Character*7 old_time
	Character*23 temp23
	Integer*2 IOSB(4)
	Integer*2 TTCh1
	External IO$M_Noecho,IO$_Readvblk,IO$M_Purge,io$m_timed,
     1	  ss$_normal
	COMMON /TTCH/ TTCH1
	include 'common.include'

C	To have a ticking clock, uncomment the code listed and the clock will 
C	be updated every second.
C-------------------------------------------------------------------C
C	x = char( 0)
C	old_time = ' '
	F1=%loc(Io$_Readvblk).OR.%Loc(Io$M_Noecho) !.or.%loc(io$m_timed)

100	stat = lib$date_time( temp23)
	Stat = Sys$Qiow(%Val(3),%Val(TTCh1),%Val(F1),%Ref(IOSB),
     1 ,,%Ref(X),%Val(1),,%Ref(Termch),,)
C     1 ,,%Ref(X),%Val(1),%val(16),%Ref(Termch),,)

C	print *, largescreen, '==============='
C	print *, %loc(io$m_timed), stat, '---------------'
C	if (stat .ne. %loc(ss$_normal)) return
C	if (stat .ne. %loc(ss$_normal)) x = char( 0)
C	if (old_time .ne. temp23( 13:19)) then
	call writel( revideo//temp23( 13:17)//dull, 23, 6)
C	if (stat .eq. %loc(io$m_timed)) return
C	old_time = temp23( 13:19)
C	end if
C	if (x .eq. char( 0)) goto 100
	If (.not. Stat) Call Lib$Stop(%Val(Stat))
	If (.not. IOSB(1)) Call Lib$Stop(%Val(IOSB(1)))
	Return
	End


C-------------------------------------------------------------------C
C Routine to input a chacter with no echo from the VT100 Crt and get
C the clock to tick.
C-------------------------------------------------------------------C
	Subroutine Get1Char_with_clock_ticking(X, Purge)
	Implicit Integer*4 (A - Z)
	Character*1 X
	Character*23 temp23
	Integer*2 IOSB(4)
	Integer*2 TTCh1
	External IO$M_Noecho,IO$_Readvblk,IO$M_Purge,io$m_timed,
     1	  ss$_timeout
	COMMON /TTCH/ TTCH1
	include 'common.include'

C	The clock will be updated every minute.
C	See I/O User's Reference Manual pg 8-27 for timeout stuff
C	QIOW is described in System Services Reference Manual pg SYS-334 thru 
C	  sys-338
C-------------------------------------------------------------------C
	F1=%loc(Io$_Readvblk).OR.%Loc(Io$M_Noecho).or.%loc(io$m_timed)

100	Stat = Sys$Qiow(%Val(3),%Val(TTCh1),%Val(F1),%Ref(IOSB),
     1 ,,%Ref(X),%Val(1),%val(61),%Ref(Termch),,)

	stat = lib$date_time( temp23)
	call writel( revideo//temp23( 13:17)//dull, 23, 6)
	If (IOSB(1) .eq. %loc(ss$_timeout)) then
	  call writel( ' ', cursorline, 79) 
	  goto 100
	end if

	If (.not. Stat) Call Lib$Stop(%Val(Stat))
	If (.not. IOSB(1)) Call Lib$Stop(%Val(IOSB(1)))
	Return
	End
