      SUBROUTINE MAIN
      LOGICAL*1 GETCH
      INTEGER NXTFIL
      LOGICAL*1 C, BUF(512)
      INTEGER TABPOS, INT, ARGCT
      INTEGER COL, I, NEWCOL, TABS(512)
      CALL QUERY(41Husage:  entab [<t1>...] [+<n>] [file] ...)
      CALL ARGTAB(BUF)
      CALL SETTAB(BUF, TABS)
      COL = 1
      ARGCT = 1
23000 IF (.NOT.(NXTFIL(ARGCT,INT) .NE. -1))GOTO 23001
23002 CONTINUE
      NEWCOL = COL
23005 IF (.NOT.(GETCH(C,INT) .EQ. 32))GOTO 23006
      NEWCOL = NEWCOL + 1
      IF (.NOT.(TABPOS(NEWCOL,TABS) .EQ. 1))GOTO 23007
      CALL PUTCH(9,2)
      COL = NEWCOL
23007 CONTINUE
      GOTO 23005
23006 CONTINUE
23009 IF (.NOT.(COL .LT. NEWCOL))GOTO 23011
      CALL PUTCH(32,2)
23010 COL = COL + 1
      GOTO 23009
23011 CONTINUE
      IF (.NOT.(C .EQ. -1))GOTO 23012
      IF (.NOT.(INT .NE. 1))GOTO 23014
      CALL CLOSE(INT)
23014 CONTINUE
      GOTO 23004
23012 CONTINUE
      CALL PUTCH(C,2)
      IF (.NOT.(C .EQ. 10))GOTO 23016
      COL = 1
      GOTO 23017
23016 CONTINUE
      COL = COL + 1
23017 CONTINUE
23003 GOTO 23002
23004 CONTINUE
      GOTO 23000
23001 CONTINUE
      RETURN
      END
      INTEGER FUNCTION NXTFIL(ARGCT,INT)
      INTEGER GETARG, OPEN, ALLDIG
      INTEGER ARGCT, INT
      INTEGER FLAG
      LOGICAL*1 ABUF(40)
      DATA FLAG /0/
      INT = 1
23018 CONTINUE
      NXTFIL = GETARG(ARGCT,ABUF,40)
      IF (.NOT.(NXTFIL .EQ. -1))GOTO 23021
      GOTO 23020
23021 CONTINUE
      IF (.NOT.(ABUF(1) .EQ. 43 .OR. ALLDIG(ABUF) .EQ. 1))GOTO 23023
      GOTO 23019
23023 CONTINUE
      FLAG = FLAG + 1
      IF (.NOT.(ABUF(1) .EQ. 45 .AND. ABUF(2) .EQ. 0))GOTO 23025
      INT = 1
      GOTO 23020
23025 CONTINUE
      INT = OPEN(ABUF,1)
      IF (.NOT.(INT .NE. -3))GOTO 23027
      GOTO 23020
23027 CONTINUE
      CALL CANT(ABUF)
23028 CONTINUE
23026 CONTINUE
23019 ARGCT = ARGCT + 1
      GOTO 23018
23020 CONTINUE
      IF (.NOT.(FLAG .EQ. 0))GOTO 23029
      FLAG = 1
      NXTFIL = 0
23029 CONTINUE
      ARGCT = ARGCT + 1
      RETURN
      END
