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 Get a file name from the VT100 keyboard.               C
C-------------------------------------------------------------------C
       Subroutine KBDNAME(X, NBytes) 
       Implicit Integer*4 (A - Z)
       Character*80 X
       Character*1 T
       Integer*2 Ch1
       Integer*2 IOSB(4),NBytes
       External IO$_Readvblk
C-------------------------------------------------------------------C
       X(1:40)  = '                                        '
       X(41:80) = '                                        ' 
       Ch1 = 0
       Stat = SYS$Assign('TT', Ch1,,)
       If (.not. Stat) Call Lib$Stop(%Val(Stat))
       F1 = %loc(Io$_Readvblk) 
       Stat = Sys$Qiow(%Val(3),%Val(Ch1),%Val(F1),%Ref(IOSB),
     1 ,,%Ref(X),%Val(80),,%Val(0),,)
       If (.not. Stat) Call Lib$Stop(%Val(Stat))
       If (.not. IOSB(1)) Call Lib$Stop(%Val(IOSB(1)))
       Stat = SYS$DAssgn(%Val(Ch1))
       If (.not. Stat) Call Lib$Stop(%Val(Stat))
       NBytes = IOSB(2) ! not including the terminating char
       S = Lib$Matchc(Char(13), X)
       Do 100 I = S, 80
         X(I:I) = ' '
100    Continue
       Do 200 I = 1, 80
         If ((IChar(X(I:I)) .GT. 96) .AND. (IChar(X(I:I)) .LT. 123)) 
     -   Then 
           X(I:I) = Char(IChar(X(I:I))-32)
         End If
200    Continue
       Return
       End
