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 write one line of data on the VT100 CRT.               C
C-------------------------------------------------------------------C
       Subroutine Writel(Data, LineNum, ColNum)
       Implicit Integer*4 (A - Z)
       Character*(*) Data
       Character*4 C4
       Integer*2 Ch1
       Integer*2 IOSB(4)
       External IO$_WriteVBlk
       common /ttch/ ttch1
C-------------------------------------------------------------------C
       Call Lib$Set_Cursor(LineNum, ColNum)
       Ch1 = 0
       Call Setterm(%Val(TTCh1)) ! disallow wraparound, etc.
       F1 = %loc(Io$_WriteVBlk)
       NBytes = Len(Data)
       If ((Nbytes + ColNum) .GT. 78) then 
         Do 100 I = Nbytes, 1, -1
           If (Data(I:I) .EQ. ' ') then
             Nbytes = Nbytes - 1
           Else
             Goto 200
           End If
100      Continue
200      Continue
         P4 = '00000000'X
         Stat = Sys$qio(%Val(4),%Val(TTCh1),%Val(F1),
     1   %Ref(IOSB),,,%Ref(Data),%Val(NBytes),,%Val(P4),,)
         If (.not. Stat) Call Lib$Stop(%Val(Stat))
         P4 = '00000000'X
         C4 = Char(27)//'[0K'
         Stat = Sys$qio(%Val(4),%Val(TTCh1),%Val(F1),
     1   %Ref(IOSB),,,%Ref(C4),%Val(4),,%Val(P4),,)
         If (.not. Stat) Call Lib$Stop(%Val(Stat))
       Else
         P4 = '00000000'X
         Stat = Sys$qio(%Val(4),%Val(TTCh1),%Val(F1),
     1   %Ref(IOSB),,,%Ref(Data),%Val(NBytes),,%Val(P4),,)
         If (.not. Stat) Call Lib$Stop(%Val(Stat))
       End If
       Return
       End
