      subroutine ExscrPackage


      integer*2 NF, NI, NR, NC, NT, NdimT, NdimC
      integer*2 NdimH, IEle, L, I

      parameter ( NF=  4,NI=  2,NR=  1,NC=  2,NT= 12 )
      parameter ( NdimT=  223,NdimC=   84,NdimH=  212 )

      integer*2 Row, Col, StartField, TermKeys(30), LastKey
      integer*2 First, Last
      logical*1 Next, Previous, Exit, Refresh
      character*80 ScrHelpLine
      integer*2 FieldNumber
      logical*1 Valid

      character*    5 C1  
      integer*2 I2  
      integer*2 I3  
      character*   79 C4  

      character*1 Text(NdimT)
      character*1 Char(NdimC)
      character*1 Help(NdimH)

      character*7 Formats(NF)

      integer*2 TextTable(5,NT), FldTable(7,NF), IntArray(5,NI)
      integer*2 CharTable(2,NC), HelpTable(4,NF)
      real RealArray(5,NR) 

      data ScrHelpLine(1:40) /
     1   'Up-Previous Field    Down-Next Field    '/
      data ScrHelpLine(41:80) /
     1   'Ctrl-Z End    F1-Return to Editing      '/

 
      data (TextTable(I,  1),I=1,5) /    1,79, 1, 1, 8/
      data (Text(I),I=    1,   79) /
     1   'l','q','q','q','q','q','q','q','q','q','q','q','q','q','q',
     1   'q','q','q','q','q','q','q','q','q','q','q','q','q','q','q',
     1   'q','q','q','q','q','q','q','q','q','q','q','q','q','q','q',
     1   'q','q','q','q','q','q','q','q','q','q','q','q','q','q','q',
     1   'q','q','q','q','q','q','q','q','q','q','q','q','q','q','q',
     1   'q','q','q',
     1   'k' /
 
      data (TextTable(I,  2),I=1,5) /   80, 1, 2, 1, 8/
      data (Text(I),I=   80,   80) /
     1   'x' /
 
      data (TextTable(I,  3),I=1,5) /   81,16, 2, 7, 0/
      data (Text(I),I=   81,   96) /
     1   'O','u','t','p','u','t',' ','F','i','l','e','n','a','m','e',
     1   ':' /
 
      data (TextTable(I,  4),I=1,5) /   97,13, 2,35, 0/
      data (Text(I),I=   97,  109) /
     1   'S','c','r','e','e','n',' ','W','i','d','t','h',
     1   ':' /
 
      data (TextTable(I,  5),I=1,5) /  110,14, 2,57, 0/
      data (Text(I),I=  110,  123) /
     1   'S','c','r','e','e','n',' ','H','e','i','g','h','t',
     1   ':' /
 
      data (TextTable(I,  6),I=1,5) /  124, 1, 2,79, 8/
      data (Text(I),I=  124,  124) /
     1   'x' /
 
      data (TextTable(I,  7),I=1,5) /  125, 1, 3, 1, 8/
      data (Text(I),I=  125,  125) /
     1   'x' /
 
      data (TextTable(I,  8),I=1,5) /  126, 1, 3,79, 8/
      data (Text(I),I=  126,  126) /
     1   'x' /
 
      data (TextTable(I,  9),I=1,5) /  127, 1, 4, 1, 8/
      data (Text(I),I=  127,  127) /
     1   'x' /
 
      data (TextTable(I, 10),I=1,5) /  128,16, 4,33, 0/
      data (Text(I),I=  128,  143) /
     1   'S','c','r','e','e','n',' ','H','e','l','p',' ','L','i','n',
     1   'e' /
 
      data (TextTable(I, 11),I=1,5) /  144, 1, 4,79, 8/
      data (Text(I),I=  144,  144) /
     1   'x' /
 
      data (TextTable(I, 12),I=1,5) /  145,79, 6, 1, 8/
      data (Text(I),I=  145,  223) /
     1   'm','q','q','q','q','q','q','q','q','q','q','q','q','q','q',
     1   'q','q','q','q','q','q','q','q','q','q','q','q','q','q','q',
     1   'q','q','q','q','q','q','q','q','q','q','q','q','q','q','q',
     1   'q','q','q','q','q','q','q','q','q','q','q','q','q','q','q',
     1   'q','q','q','q','q','q','q','q','q','q','q','q','q','q','q',
     1   'q','q','q',
     1   'j' /
 
      data (FldTable(I,    1),I=1,7) / 3,    1,1, 5, 2,24,1 /
      data (CharTable(I,    1),I=1,2) /     1,0 /
      data (HelpTable(I,    1),I=1,4) /     1,   51,    0,    0 /
      data (Help(I),I=    1,   51) /
     1   'E','n','t','e','r',' ','a',' ','f','i','v','e',' ','c','h',
     1   'a','r','a','c','t','e','r',' ','f','i','l','e','n','a','m',
     1   'e',' ','f','o','r',' ','t','h','e',' ','o','u','t','p','u',
     1   't',' ','f','i','l',
     1   'e' /
      data Formats(    1) / 'A 5    '/
 
      data (FldTable(I,    2),I=1,7) / 1,    1,1, 2, 2,49,1 /
      data (IntArray(I,    1),I=2,5) /
     1              1,          80,1,           0 /
      data (HelpTable(I,    2),I=1,4) /    52,   63,    0,    0 /
      data (Help(I),I=   52,  114) /
     1   'E','n','t','e','r',' ','t','h','e',' ','w','i','d','t','h',
     1   ' ','o','f',' ','t','h','e',' ','w','i','d','t','h',' ','o',
     1   'f',' ','t','h','e',' ','s','c','r','e','e','n',' ','a','s',
     1   ' ','n','u','m','b','e','r',' ','o','f',' ','c','o','l','u',
     1   'm','n',
     1   's' /
      data Formats(    2) / 'I 2    '/
 
      data (FldTable(I,    3),I=1,7) / 1,    2,1, 2, 2,72,1 /
      data (IntArray(I,    2),I=2,5) /
     1              1,          24,1,           0 /
      data (HelpTable(I,    3),I=1,4) /   115,   52,    0,    0 /
      data (Help(I),I=  115,  166) /
     1   'E','n','t','e','r',' ','t','h','e',' ','h','e','i','g','h',
     1   't',' ','o','f',' ','t','h','e',' ','s','c','r','e','e','n',
     1   ' ','a','s',' ','t','h','e',' ','n','u','m','b','e','r',' ',
     1   'o','f',' ','r','o','w',
     1   's' /
      data Formats(    3) / 'I 2    '/
 
      data (FldTable(I,    4),I=1,7) / 3,    2,3,79, 5, 1,1 /
      data (CharTable(I,    2),I=1,2) /     6,1 /
      data (HelpTable(I,    4),I=1,4) /   167,   46,    0,    0 /
      data (Help(I),I=  167,  212) /
     1   'E','n','t','e','r',' ','u','p',' ','t','o',' ','7','9',' ',
     1   'c','h','a','r','a','c','t','e','r','s',' ','f','o','r',' ',
     1   'a',' ','u','s','e','r',' ','m','e','n','u',' ','l','i','n',
     1   'e' /
      data Formats(    4) / 'A79    '/


      entry ExscrClear( Row, Col )


      call ClearScrn( Row, Col, 80,  6 )

      return



      entry ExscrTextDsp( Row, Col )

      call DsplyText( Row, Col,
     1   NT, TextTable, NdimT, Text )

      return


      entry ExscrDataDsp( Row, Col, First, Last,
     1   C1  ,I2  ,I3  ,C4
     1   )
 
      IEle = FldTable(2,  1)
      L = FldTable(4,  1)
      call ANtoA1( C1  , NdimC, Char, CharTable(1,IEle), L )
 
      IntArray(1,FldTable(2,  2)) = I2  
 
      IntArray(1,FldTable(2,  3)) = I3  
 
      IEle = FldTable(2,  4)
      L = FldTable(4,  4)
      call ANtoA1( C4  , NdimC, Char, CharTable(1,IEle), L )

      call DsplyData( Row, Col, First, Last,
     1   NF, FldTable,
     1   NI, IntArray, NR, RealArray, NC, CharTable, NdimC, Char,
     1   Formats )

      return


      entry ExscrValidate( First, Last,
     1   C1  ,I2  ,I3  ,C4
     1  , Valid, FieldNumber )
 
      IEle = FldTable(2,  1)
      L = FldTable(4,  1)
      call ANtoA1( C1  , NdimC, Char, CharTable(1,IEle), L )
 
      IntArray(1,FldTable(2,  2)) = I2  
 
      IntArray(1,FldTable(2,  3)) = I3  
 
      IEle = FldTable(2,  4)
      L = FldTable(4,  4)
      call ANtoA1( C4  , NdimC, Char, CharTable(1,IEle), L )

      call VldWholeScreen( First, Last, NF, FldTable,
     1   NI, IntArray, NR, RealArray, NC, CharTable, NdimC, Char,
     1   'EXSCR', Valid, FieldNumber )

      return


      entry ExscrEdit( Row, Col, First, Last, StartField, TermKeys,
     1   C1  ,I2  ,I3  ,C4  ,
     1   Next, Previous, Exit, Refresh, LastKey )
 
      IEle = FldTable(2,  1)
      L = FldTable(4,  1)
      call ANtoA1( C1  , NdimC, Char, CharTable(1,IEle), L )
 
      IntArray(1,FldTable(2,  2)) = I2  
 
      IntArray(1,FldTable(2,  3)) = I3  
 
      IEle = FldTable(2,  4)
      L = FldTable(4,  4)
      call ANtoA1( C4  , NdimC, Char, CharTable(1,IEle), L )

      call EditScrn( 'EXSCR', Row, Col, First, Last, StartField,
     1   ScrHelpLine, TermKeys, NF, FldTable,
     1   NI, IntArray, NR, RealArray, NC, CharTable, NdimC, Char,
     1   Formats, HelpTable, NdimH, Help, Next, Previous, Exit,
     1   Refresh, LastKey )
 
      IEle = FldTable(2,  1)
      L = FldTable(4,  1)
      call A1toAN( NdimC, Char, CharTable(1,IEle), L, C1   )
 
      I2   = IntArray(1,FldTable(2,  2))
 
      I3   = IntArray(1,FldTable(2,  3))
 
      IEle = FldTable(2,  4)
      L = FldTable(4,  4)
      call A1toAN( NdimC, Char, CharTable(1,IEle), L, C4   )

      return
      end


      integer*2 function ExscrIndex( Name )

      integer*2 I
      character*(*) Name
      character*32 LocName
      character*32 FldName(  4)
      data FldName(  1) /'FILENAME'/
      data FldName(  2) /'WIDTH'/
      data FldName(  3) /'HEIGHT'/
      data FldName(  4) /'SCREENHELPLINE'/

      LocName = Name
      call CvtToUpCase( LocName )
      do 100 I = 1 ,   4
        if( FldName(I) .eq. LocName ) then
          ExscrIndex = I
          return
        end if
100   continue

      ExscrIndex = 0

      end
