      INTEGER FUNCTION COPY(LINE3)
      INTEGER LINE3
      COMMON /CLINES/LINE10,LINE20,NLINE0,CURLN0,LASTL0
      INTEGER LINE10,LINE20,NLINE0,CURLN0,LASTL0
      COMMON /CPAT/PATAA0(256),TLPAT0(256),SUBSA0(256),TSETA0(256)
      INTEGER PATAA0,TLPAT0,SUBSA0,TSETA0
      COMMON /CTXT/TXTAA0(512)
      INTEGER TXTAA0
      COMMON /CFILE/SAVFI0(512)
      INTEGER SAVFI0
      COMMON /CBUFR$/LASTB0,FENCE0,FREEA0,LINE00,BUFAA0(65520)
      INTEGER LASTB0,FENCE0,FREEA0,LINE00
      INTEGER BUFAA0
      INTEGER PREVL0(1),NEXTL0(1)
      INTEGER GLOBM0(1),LINEL0(1)
      INTEGER * 4 SEEKA0(1)
      INTEGER MARKN0(1)
      COMMON /CUNDO/LIMBO0,LIMCN0
      INTEGER LIMBO0,LIMCN0
      COMMON /CSCRAT/SCRAA0,SCREN0,SCRNA0(512),LOSTL0
      INTEGER SCRAA0
      INTEGER * 4 SCREN0
      INTEGER SCRNA0
      INTEGER LOSTL0
      COMMON /CMISC/BUFFE0,ERRCO0,SAVER0,PROBA0,ARGNO0,LASTC0,PEEKC0,SAV
     *CO0
      INTEGER BUFFE0,ERRCO0,SAVER0,PROBA0,ARGNO0,LASTC0
      INTEGER PEEKC0,SAVCO0(512)
      COMMON /CMARK/SAVKN0
      INTEGER SAVKN0
      COMMON /COPT/TABST0(512),TABSU0(512),UNPRI0,DDIRA0,ABSNO0,NCHOI0,O
     *VERM0,WARNC0,FIRST0,TSPEE0,INDEN0,GLOBA0
      INTEGER TABST0,TABSU0,UNPRI0
      INTEGER DDIRA0,ABSNO0,NCHOI0,OVERM0,WARNC0,FIRST0,TSPEE0,INDEN0,GL
     *OBA0
      COMMON /CTERM/TERMT0
      INTEGER TERMT0
      COMMON /CSCRN/SCREE0(128,51),MSGAL0(128),NROWS0,NCOLS0,CURRO0,CURC
     *O0,TOPRO0,BOTRO0,CMDRO0,TOPLN0,INSER0,INVER0,FIRSU0,RELAA0,RELZA0,
     *SCLEN0,SCTOP0,SCLIN0
      INTEGER SCREE0
      INTEGER MSGAL0,NROWS0,NCOLS0,CURRO0,CURCO0,TOPRO0,BOTRO0,CMDRO0,TO
     *PLN0,INSER0,INVER0,FIRSU0,RELAA0,RELZA0,SCLEN0,SCTOP0,SCLIN0(51)
      COMMON /CUNIX0/UNIXM0,BACKS0,NOTIN0,XMARK0,ESCAP0
      INTEGER UNIXM0
      INTEGER BACKS0,NOTIN0,XMARK0,ESCAP0
      COMMON /CTTY/TTYST0
      INTEGER TTYST0
      INTEGER I
      INTEGER INJECT
      INTEGER PTR3,AFTER3,K
      INTEGER GETIND
      LOGICAL INTRPT,BRKFL0
      EQUIVALENCE (PREVL0(1),BUFAA0(1)),(NEXTL0(1),BUFAA0(2)),(GLOBM0(1)
     *,BUFAA0(3)),(SEEKA0(1),BUFAA0(4)),(LINEL0(1),BUFAA0(6)),(MARKN0(1)
     *,BUFAA0(7))
      COPY=-3
      PTR3=GETIND(LINE3)
      AFTER3=NEXTL0(PTR3)
      IF((LINE10.GT.0))GOTO 10000
        ERRCO0=17
        GOTO 10001
10000   COPY=-2
        CURLN0=LINE3
        K=GETIND(LINE10)
        I=LINE10
        GOTO 10004
10002   I=I+(1)
10004   IF((I.GT.LINE20))GOTO 10003
          CALL GTXT(K)
          IF((INJECT(TXTAA0).EQ.-3))GOTO 10006
          IF(INTRPT(BRKFL0))GOTO 10006
          GOTO 10005
10006       COPY=-3
            GOTO 10003
10005     IF((K.NE.PTR3))GOTO 10007
            K=AFTER3
            GOTO 10002
10007       K=NEXTL0(K)
10008   GOTO 10002
10003   FIRSU0=MIN0(FIRSU0,LINE3+1)
10001 RETURN
      END
      SUBROUTINE CPROW(FROM,TO)
      INTEGER FROM,TO
      COMMON /CLINES/LINE10,LINE20,NLINE0,CURLN0,LASTL0
      INTEGER LINE10,LINE20,NLINE0,CURLN0,LASTL0
      COMMON /CPAT/PATAA0(256),TLPAT0(256),SUBSA0(256),TSETA0(256)
      INTEGER PATAA0,TLPAT0,SUBSA0,TSETA0
      COMMON /CTXT/TXTAA0(512)
      INTEGER TXTAA0
      COMMON /CFILE/SAVFI0(512)
      INTEGER SAVFI0
      COMMON /CBUFR$/LASTB0,FENCE0,FREEA0,LINE00,BUFAA0(65520)
      INTEGER LASTB0,FENCE0,FREEA0,LINE00
      INTEGER BUFAA0
      INTEGER PREVL0(1),NEXTL0(1)
      INTEGER GLOBM0(1),LINEL0(1)
      INTEGER * 4 SEEKA0(1)
      INTEGER MARKN0(1)
      COMMON /CUNDO/LIMBO0,LIMCN0
      INTEGER LIMBO0,LIMCN0
      COMMON /CSCRAT/SCRAA0,SCREN0,SCRNA0(512),LOSTL0
      INTEGER SCRAA0
      INTEGER * 4 SCREN0
      INTEGER SCRNA0
      INTEGER LOSTL0
      COMMON /CMISC/BUFFE0,ERRCO0,SAVER0,PROBA0,ARGNO0,LASTC0,PEEKC0,SAV
     *CO0
      INTEGER BUFFE0,ERRCO0,SAVER0,PROBA0,ARGNO0,LASTC0
      INTEGER PEEKC0,SAVCO0(512)
      COMMON /CMARK/SAVKN0
      INTEGER SAVKN0
      COMMON /COPT/TABST0(512),TABSU0(512),UNPRI0,DDIRA0,ABSNO0,NCHOI0,O
     *VERM0,WARNC0,FIRST0,TSPEE0,INDEN0,GLOBA0
      INTEGER TABST0,TABSU0,UNPRI0
      INTEGER DDIRA0,ABSNO0,NCHOI0,OVERM0,WARNC0,FIRST0,TSPEE0,INDEN0,GL
     *OBA0
      COMMON /CTERM/TERMT0
      INTEGER TERMT0
      COMMON /CSCRN/SCREE0(128,51),MSGAL0(128),NROWS0,NCOLS0,CURRO0,CURC
     *O0,TOPRO0,BOTRO0,CMDRO0,TOPLN0,INSER0,INVER0,FIRSU0,RELAA0,RELZA0,
     *SCLEN0,SCTOP0,SCLIN0
      INTEGER SCREE0
      INTEGER MSGAL0,NROWS0,NCOLS0,CURRO0,CURCO0,TOPRO0,BOTRO0,CMDRO0,TO
     *PLN0,INSER0,INVER0,FIRSU0,RELAA0,RELZA0,SCLEN0,SCTOP0,SCLIN0(51)
      COMMON /CUNIX0/UNIXM0,BACKS0,NOTIN0,XMARK0,ESCAP0
      INTEGER UNIXM0
      INTEGER BACKS0,NOTIN0,XMARK0,ESCAP0
      COMMON /CTTY/TTYST0
      INTEGER TTYST0
      INTEGER COL
      EQUIVALENCE (PREVL0(1),BUFAA0(1)),(NEXTL0(1),BUFAA0(2)),(GLOBM0(1)
     *,BUFAA0(3)),(SEEKA0(1),BUFAA0(4)),(LINEL0(1),BUFAA0(6)),(MARKN0(1)
     *,BUFAA0(7))
      COL=1
      GOTO 10011
10009 COL=COL+(1)
10011 IF((COL.GT.NCOLS0))GOTO 10010
        CALL LOAD(SCREE0(COL,FROM),TO,COL)
      GOTO 10009
10010 RETURN
      END
      SUBROUTINE DOHELP(LIN,I,STATUS)
      INTEGER LIN(1)
      INTEGER I,STATUS
      COMMON /CLINES/LINE10,LINE20,NLINE0,CURLN0,LASTL0
      INTEGER LINE10,LINE20,NLINE0,CURLN0,LASTL0
      COMMON /CPAT/PATAA0(256),TLPAT0(256),SUBSA0(256),TSETA0(256)
      INTEGER PATAA0,TLPAT0,SUBSA0,TSETA0
      COMMON /CTXT/TXTAA0(512)
      INTEGER TXTAA0
      COMMON /CFILE/SAVFI0(512)
      INTEGER SAVFI0
      COMMON /CBUFR$/LASTB0,FENCE0,FREEA0,LINE00,BUFAA0(65520)
      INTEGER LASTB0,FENCE0,FREEA0,LINE00
      INTEGER BUFAA0
      INTEGER PREVL0(1),NEXTL0(1)
      INTEGER GLOBM0(1),LINEL0(1)
      INTEGER * 4 SEEKA0(1)
      INTEGER MARKN0(1)
      COMMON /CUNDO/LIMBO0,LIMCN0
      INTEGER LIMBO0,LIMCN0
      COMMON /CSCRAT/SCRAA0,SCREN0,SCRNA0(512),LOSTL0
      INTEGER SCRAA0
      INTEGER * 4 SCREN0
      INTEGER SCRNA0
      INTEGER LOSTL0
      COMMON /CMISC/BUFFE0,ERRCO0,SAVER0,PROBA0,ARGNO0,LASTC0,PEEKC0,SAV
     *CO0
      INTEGER BUFFE0,ERRCO0,SAVER0,PROBA0,ARGNO0,LASTC0
      INTEGER PEEKC0,SAVCO0(512)
      COMMON /CMARK/SAVKN0
      INTEGER SAVKN0
      COMMON /COPT/TABST0(512),TABSU0(512),UNPRI0,DDIRA0,ABSNO0,NCHOI0,O
     *VERM0,WARNC0,FIRST0,TSPEE0,INDEN0,GLOBA0
      INTEGER TABST0,TABSU0,UNPRI0
      INTEGER DDIRA0,ABSNO0,NCHOI0,OVERM0,WARNC0,FIRST0,TSPEE0,INDEN0,GL
     *OBA0
      COMMON /CTERM/TERMT0
      INTEGER TERMT0
      COMMON /CSCRN/SCREE0(128,51),MSGAL0(128),NROWS0,NCOLS0,CURRO0,CURC
     *O0,TOPRO0,BOTRO0,CMDRO0,TOPLN0,INSER0,INVER0,FIRSU0,RELAA0,RELZA0,
     *SCLEN0,SCTOP0,SCLIN0
      INTEGER SCREE0
      INTEGER MSGAL0,NROWS0,NCOLS0,CURRO0,CURCO0,TOPRO0,BOTRO0,CMDRO0,TO
     *PLN0,INSER0,INVER0,FIRSU0,RELAA0,RELZA0,SCLEN0,SCTOP0,SCLIN0(51)
      COMMON /CUNIX0/UNIXM0,BACKS0,NOTIN0,XMARK0,ESCAP0
      INTEGER UNIXM0
      INTEGER BACKS0,NOTIN0,XMARK0,ESCAP0
      COMMON /CTTY/TTYST0
      INTEGER TTYST0
      INTEGER FILEN0(128)
      INTEGER UNIXH0(128)
      INTEGER FD,L
      INTEGER OPEN,SCOPY
      INTEGER FILTST
      INTEGER K
      INTEGER AAAAA0(15)
      INTEGER AAAAB0(12)
      INTEGER AAAAC0(8)
      EQUIVALENCE (PREVL0(1),BUFAA0(1)),(NEXTL0(1),BUFAA0(2)),(GLOBM0(1)
     *,BUFAA0(3)),(SEEKA0(1),BUFAA0(4)),(LINEL0(1),BUFAA0(6)),(MARKN0(1)
     *,BUFAA0(7))
      DATA AAAAA0/189,228,239,227,189,175,243,229,223,232,175,229,236,24
     *0,0/
      DATA AAAAB0/189,228,239,227,189,175,243,229,223,232,175,0/
      DATA AAAAC0/170,243,223,245,238,233,248,0/
10012 IF((LIN(I).NE.160))GOTO 10013
        I=I+(1)
      GOTO 10012
10013 IF((LIN(I).NE.138))GOTO 10014
        CALL SCOPY(AAAAA0,1,FILEN0,1)
        GOTO 10015
10014   L=SCOPY(AAAAB0,1,FILEN0,1)
        L=L+(SCOPY(LIN,I,FILEN0,L+1))
        FILEN0(L)=0
10015 CALL ENCODE(UNIXH0,128,AAAAC0,FILEN0)
      IF((UNIXM0.NE.1))GOTO 10016
      IF((FILTST(UNIXH0,0,0,1,0,1,0,0).NE.1))GOTO 10016
        CALL SCOPY(UNIXH0,1,FILEN0,1)
10016 STATUS=-2
      FD=OPEN(FILEN0,1)
      IF((FD.NE.-3))GOTO 10017
        STATUS=-3
        ERRCO0=31
        GOTO 10018
10017   CALL DISPL0(FD)
        CALL CLOSE(FD)
10018 RETURN
      END
      INTEGER FUNCTION DISPL0(FD)
      INTEGER FD
      COMMON /CLINES/LINE10,LINE20,NLINE0,CURLN0,LASTL0
      INTEGER LINE10,LINE20,NLINE0,CURLN0,LASTL0
      COMMON /CPAT/PATAA0(256),TLPAT0(256),SUBSA0(256),TSETA0(256)
      INTEGER PATAA0,TLPAT0,SUBSA0,TSETA0
      COMMON /CTXT/TXTAA0(512)
      INTEGER TXTAA0
      COMMON /CFILE/SAVFI0(512)
      INTEGER SAVFI0
      COMMON /CBUFR$/LASTB0,FENCE0,FREEA0,LINE00,BUFAA0(65520)
      INTEGER LASTB0,FENCE0,FREEA0,LINE00
      INTEGER BUFAA0
      INTEGER PREVL0(1),NEXTL0(1)
      INTEGER GLOBM0(1),LINEL0(1)
      INTEGER * 4 SEEKA0(1)
      INTEGER MARKN0(1)
      COMMON /CUNDO/LIMBO0,LIMCN0
      INTEGER LIMBO0,LIMCN0
      COMMON /CSCRAT/SCRAA0,SCREN0,SCRNA0(512),LOSTL0
      INTEGER SCRAA0
      INTEGER * 4 SCREN0
      INTEGER SCRNA0
      INTEGER LOSTL0
      COMMON /CMISC/BUFFE0,ERRCO0,SAVER0,PROBA0,ARGNO0,LASTC0,PEEKC0,SAV
     *CO0
      INTEGER BUFFE0,ERRCO0,SAVER0,PROBA0,ARGNO0,LASTC0
      INTEGER PEEKC0,SAVCO0(512)
      COMMON /CMARK/SAVKN0
      INTEGER SAVKN0
      COMMON /COPT/TABST0(512),TABSU0(512),UNPRI0,DDIRA0,ABSNO0,NCHOI0,O
     *VERM0,WARNC0,FIRST0,TSPEE0,INDEN0,GLOBA0
      INTEGER TABST0,TABSU0,UNPRI0
      INTEGER DDIRA0,ABSNO0,NCHOI0,OVERM0,WARNC0,FIRST0,TSPEE0,INDEN0,GL
     *OBA0
      COMMON /CTERM/TERMT0
      INTEGER TERMT0
      COMMON /CSCRN/SCREE0(128,51),MSGAL0(128),NROWS0,NCOLS0,CURRO0,CURC
     *O0,TOPRO0,BOTRO0,CMDRO0,TOPLN0,INSER0,INVER0,FIRSU0,RELAA0,RELZA0,
     *SCLEN0,SCTOP0,SCLIN0
      INTEGER SCREE0
      INTEGER MSGAL0,NROWS0,NCOLS0,CURRO0,CURCO0,TOPRO0,BOTRO0,CMDRO0,TO
     *PLN0,INSER0,INVER0,FIRSU0,RELAA0,RELZA0,SCLEN0,SCTOP0,SCLIN0(51)
      COMMON /CUNIX0/UNIXM0,BACKS0,NOTIN0,XMARK0,ESCAP0
      INTEGER UNIXM0
      INTEGER BACKS0,NOTIN0,XMARK0,ESCAP0
      COMMON /CTTY/TTYST0
      INTEGER TTYST0
      INTEGER LIN(128)
      INTEGER ROW,COL,ENDOF0,K
      INTEGER GETLIN,LENGTH
      INTEGER MORE(24)
      INTEGER AAAAD0(28)
      EQUIVALENCE (PREVL0(1),BUFAA0(1)),(NEXTL0(1),BUFAA0(2)),(GLOBM0(1)
     *,BUFAA0(3)),(SEEKA0(1),BUFAA0(4)),(LINEL0(1),BUFAA0(6)),(MARKN0(1)
     *,BUFAA0(7))
      DATA MORE/160,205,160,207,160,210,160,197,160,160,212,160,207,160,
     *160,195,160,207,160,205,160,197,160,0/
      DATA AAAAD0/197,238,244,229,242,160,239,173,160,244,239,160,242,22
     *9,243,244,239,242,229,160,228,233,243,240,236,225,249,0/
      IF((TOPRO0.LE.1))GOTO 10019
        TOPLN0=MAX0(1,TOPLN0-(TOPRO0-1))
        TOPRO0=1
10019 ENDOF0=0
      ROW=TOPRO0
      GOTO 10022
10020 ROW=ROW+(1)
10022 IF((ROW.GT.BOTRO0-3))GOTO 10021
        IF((GETLIN(LIN,FD,NCOLS0).NE.-1))GOTO 10023
          ENDOF0=1
          GOTO 10021
10023   TOPRO0=TOPRO0+(1)
        TOPLN0=TOPLN0+(1)
        CALL LOADS0(LIN,ROW,1,NCOLS0)
      GOTO 10020
10021 IF((ENDOF0.NE.0))GOTO 10024
        K=(NCOLS0-LENGTH(MORE))/2
        COL=1
        GOTO 10027
10025   COL=COL+(1)
10027   IF((COL.GT.K))GOTO 10026
          CALL LOAD(170,ROW,COL)
        GOTO 10025
10026   K=1
        GOTO 10030
10028   K=K+(1)
        COL=COL+(1)
10030   IF((MORE(K).EQ.0))GOTO 10033
          CALL LOAD(MORE(K),ROW,COL)
        GOTO 10028
10031   COL=COL+(1)
10033   IF((COL.GT.NCOLS0))GOTO 10032
          CALL LOAD(170,ROW,COL)
        GOTO 10031
10032   TOPRO0=TOPRO0+(1)
        TOPLN0=TOPLN0+(1)
        ROW=ROW+(1)
10024 DO 10034 COL=1,NCOLS0
        CALL LOAD(173,ROW,COL)
10034 CONTINUE
10035 TOPRO0=TOPRO0+(1)
      TOPLN0=TOPLN0+(1)
      IF((TOPLN0.LE.LASTL0))GOTO 10036
        CALL ADJUS0(1,LASTL0)
10036 IF((CURLN0.GE.TOPLN0))GOTO 10037
        CURLN0=MIN0(TOPLN0,LASTL0)
10037 FIRSU0=TOPLN0
      CALL MESG(AAAAD0,10)
      IF((ENDOF0.NE.1))GOTO 10038
        DISPL0=-1
        RETURN
10038 DISPL0=-2
      RETURN
      END
      INTEGER FUNCTION DOMARK(KNAME)
      INTEGER KNAME
      COMMON /CLINES/LINE10,LINE20,NLINE0,CURLN0,LASTL0
      INTEGER LINE10,LINE20,NLINE0,CURLN0,LASTL0
      COMMON /CPAT/PATAA0(256),TLPAT0(256),SUBSA0(256),TSETA0(256)
      INTEGER PATAA0,TLPAT0,SUBSA0,TSETA0
      COMMON /CTXT/TXTAA0(512)
      INTEGER TXTAA0
      COMMON /CFILE/SAVFI0(512)
      INTEGER SAVFI0
      COMMON /CBUFR$/LASTB0,FENCE0,FREEA0,LINE00,BUFAA0(65520)
      INTEGER LASTB0,FENCE0,FREEA0,LINE00
      INTEGER BUFAA0
      INTEGER PREVL0(1),NEXTL0(1)
      INTEGER GLOBM0(1),LINEL0(1)
      INTEGER * 4 SEEKA0(1)
      INTEGER MARKN0(1)
      COMMON /CUNDO/LIMBO0,LIMCN0
      INTEGER LIMBO0,LIMCN0
      COMMON /CSCRAT/SCRAA0,SCREN0,SCRNA0(512),LOSTL0
      INTEGER SCRAA0
      INTEGER * 4 SCREN0
      INTEGER SCRNA0
      INTEGER LOSTL0
      COMMON /CMISC/BUFFE0,ERRCO0,SAVER0,PROBA0,ARGNO0,LASTC0,PEEKC0,SAV
     *CO0
      INTEGER BUFFE0,ERRCO0,SAVER0,PROBA0,ARGNO0,LASTC0
      INTEGER PEEKC0,SAVCO0(512)
      COMMON /CMARK/SAVKN0
      INTEGER SAVKN0
      COMMON /COPT/TABST0(512),TABSU0(512),UNPRI0,DDIRA0,ABSNO0,NCHOI0,O
     *VERM0,WARNC0,FIRST0,TSPEE0,INDEN0,GLOBA0
      INTEGER TABST0,TABSU0,UNPRI0
      INTEGER DDIRA0,ABSNO0,NCHOI0,OVERM0,WARNC0,FIRST0,TSPEE0,INDEN0,GL
     *OBA0
      COMMON /CTERM/TERMT0
      INTEGER TERMT0
      COMMON /CSCRN/SCREE0(128,51),MSGAL0(128),NROWS0,NCOLS0,CURRO0,CURC
     *O0,TOPRO0,BOTRO0,CMDRO0,TOPLN0,INSER0,INVER0,FIRSU0,RELAA0,RELZA0,
     *SCLEN0,SCTOP0,SCLIN0
      INTEGER SCREE0
      INTEGER MSGAL0,NROWS0,NCOLS0,CURRO0,CURCO0,TOPRO0,BOTRO0,CMDRO0,TO
     *PLN0,INSER0,INVER0,FIRSU0,RELAA0,RELZA0,SCLEN0,SCTOP0,SCLIN0(51)
      COMMON /CUNIX0/UNIXM0,BACKS0,NOTIN0,XMARK0,ESCAP0
      INTEGER UNIXM0
      INTEGER BACKS0,NOTIN0,XMARK0,ESCAP0
      COMMON /CTTY/TTYST0
      INTEGER TTYST0
      INTEGER LINE
      INTEGER K
      INTEGER GETIND
      LOGICAL INTRPT,BRKFL0
      EQUIVALENCE (PREVL0(1),BUFAA0(1)),(NEXTL0(1),BUFAA0(2)),(GLOBM0(1)
     *,BUFAA0(3)),(SEEKA0(1),BUFAA0(4)),(LINEL0(1),BUFAA0(6)),(MARKN0(1)
     *,BUFAA0(7))
      IF((LINE10.GT.0))GOTO 10039
        ERRCO0=17
        DOMARK=-3
        GOTO 10040
10039   K=GETIND(LINE10)
        LINE=LINE10
        GOTO 10043
10041   K=NEXTL0(K)
        LINE=LINE+(1)
10043   IF((LINE.GT.LINE20))GOTO 10042
          IF((.NOT.INTRPT(BRKFL0)))GOTO 10044
            DOMARK=-3
            RETURN
10044     MARKN0(K)=KNAME
        GOTO 10041
10042   DOMARK=-2
10040 RETURN
      END
      INTEGER FUNCTION DOOPT(LIN,I)
      INTEGER LIN(1)
      INTEGER I
      COMMON /CLINES/LINE10,LINE20,NLINE0,CURLN0,LASTL0
      INTEGER LINE10,LINE20,NLINE0,CURLN0,LASTL0
      COMMON /CPAT/PATAA0(256),TLPAT0(256),SUBSA0(256),TSETA0(256)
      INTEGER PATAA0,TLPAT0,SUBSA0,TSETA0
      COMMON /CTXT/TXTAA0(512)
      INTEGER TXTAA0
      COMMON /CFILE/SAVFI0(512)
      INTEGER SAVFI0
      COMMON /CBUFR$/LASTB0,FENCE0,FREEA0,LINE00,BUFAA0(65520)
      INTEGER LASTB0,FENCE0,FREEA0,LINE00
      INTEGER BUFAA0
      INTEGER PREVL0(1),NEXTL0(1)
      INTEGER GLOBM0(1),LINEL0(1)
      INTEGER * 4 SEEKA0(1)
      INTEGER MARKN0(1)
      COMMON /CUNDO/LIMBO0,LIMCN0
      INTEGER LIMBO0,LIMCN0
      COMMON /CSCRAT/SCRAA0,SCREN0,SCRNA0(512),LOSTL0
      INTEGER SCRAA0
      INTEGER * 4 SCREN0
      INTEGER SCRNA0
      INTEGER LOSTL0
      COMMON /CMISC/BUFFE0,ERRCO0,SAVER0,PROBA0,ARGNO0,LASTC0,PEEKC0,SAV
     *CO0
      INTEGER BUFFE0,ERRCO0,SAVER0,PROBA0,ARGNO0,LASTC0
      INTEGER PEEKC0,SAVCO0(512)
      COMMON /CMARK/SAVKN0
      INTEGER SAVKN0
      COMMON /COPT/TABST0(512),TABSU0(512),UNPRI0,DDIRA0,ABSNO0,NCHOI0,O
     *VERM0,WARNC0,FIRST0,TSPEE0,INDEN0,GLOBA0
      INTEGER TABST0,TABSU0,UNPRI0
      INTEGER DDIRA0,ABSNO0,NCHOI0,OVERM0,WARNC0,FIRST0,TSPEE0,INDEN0,GL
     *OBA0
      COMMON /CTERM/TERMT0
      INTEGER TERMT0
      COMMON /CSCRN/SCREE0(128,51),MSGAL0(128),NROWS0,NCOLS0,CURRO0,CURC
     *O0,TOPRO0,BOTRO0,CMDRO0,TOPLN0,INSER0,INVER0,FIRSU0,RELAA0,RELZA0,
     *SCLEN0,SCTOP0,SCLIN0
      INTEGER SCREE0
      INTEGER MSGAL0,NROWS0,NCOLS0,CURRO0,CURCO0,TOPRO0,BOTRO0,CMDRO0,TO
     *PLN0,INSER0,INVER0,FIRSU0,RELAA0,RELZA0,SCLEN0,SCTOP0,SCLIN0(51)
      COMMON /CUNIX0/UNIXM0,BACKS0,NOTIN0,XMARK0,ESCAP0
      INTEGER UNIXM0
      INTEGER BACKS0,NOTIN0,XMARK0,ESCAP0
      COMMON /CTTY/TTYST0
      INTEGER TTYST0
      INTEGER TEMP,LINE,STAT,DF
      INTEGER CTOI,GETNUM,SETTAB,DOSOPT,SENDM0
      INTEGER DELETE,CKCHAR
      INTEGER TEMPS0(4),NAME(512)
      INTEGER AAAAE0
      INTEGER AAAAF0
      INTEGER AAAAG0(5)
      INTEGER AAAAH0(1)
      INTEGER AAAAI0
      INTEGER AAAAJ0(3)
      INTEGER AAAAK0(1)
      INTEGER AAAAL0(4)
      INTEGER AAAAM0
      INTEGER AAAAN0(5)
      EQUIVALENCE (PREVL0(1),BUFAA0(1)),(NEXTL0(1),BUFAA0(2)),(GLOBM0(1)
     *,BUFAA0(3)),(SEEKA0(1),BUFAA0(4)),(LINEL0(1),BUFAA0(6)),(MARKN0(1)
     *,BUFAA0(7))
      DATA AAAAG0/213,206,201,216,0/
      DATA AAAAH0/0/
      DATA AAAAJ0/171,179,0/
      DATA AAAAK0/0/
      DATA AAAAL0/183,171,179,0/
      DATA AAAAN0/195,193,211,197,0/
      I=I+1
      DOOPT=-3
      AAAAE0=LIN(I)
      GOTO 10045
10046   IF((LIN(I+1).NE.138))GOTO 10050
          DOOPT=-2
          GLOBA0=1+0-GLOBA0
          IF((GLOBA0.NE.1))GOTO 10048
            CALL REMARK('failed global substitutes continue.')
            GOTO 10049
10048       CALL REMARK('failed global substitutes stop.')
10049   CONTINUE
10047 GOTO 10050
10051   IF((NLINE0.EQ.0))GOTO 10052
          ERRCO0=32
          GOTO 10050
10052     IF((LIN(I+1).NE.138))GOTO 10054
            DOOPT=-2
            IF((BUFFE0.NE.1))GOTO 10055
              CALL REMARK('not saved.')
              GOTO 10056
10055         CALL REMARK('saved.')
10056     CONTINUE
10054   CONTINUE
10053 GOTO 10050
10057   I=I+(1)
        IF((LIN(I).NE.138))GOTO 10058
          IF((NLINE0.EQ.0))GOTO 10059
            ERRCO0=32
            GOTO 10050
10059       CALL RECVM0
            DOOPT=-2
10060     GOTO 10050
10058     IF((CKCHAR(196,228,LIN,I,DF,TEMP).NE.-2))GOTO 10062
          IF((LIN(I).NE.160))GOTO 10062
            CALL GETWRD(LIN,I,NAME,512)
            IF((LIN(I).NE.138))GOTO 10063
              DOOPT=SENDM0(NAME,LINE10,LINE20)
              IF((DOOPT.NE.-2))GOTO 10064
              IF((DF.NE.0))GOTO 10064
                DOOPT=DELETE(LINE10,LINE20,TEMP)
10064       CONTINUE
10063     CONTINUE
10062   CONTINUE
10061 GOTO 10050
10065   DOOPT=-2
        AAAAF0=LIN(I+1)
        GOTO 10066
10067     IF((UNIXM0.NE.1))GOTO 10068
            GOTO 1
10068       GOTO 2
10069     CONTINUE
1         UNIXM0=0
          BACKS0=220
          NOTIN0=254
          XMARK0=161
          ESCAP0=192
        GOTO 10070
10071     CONTINUE
2         UNIXM0=1
          BACKS0=191
          NOTIN0=222
          XMARK0=254
          ESCAP0=220
        GOTO 10070
10070     CALL SETPAT(UNIXM0)
          IF((UNIXM0.NE.1))GOTO 10072
            CALL MESG(AAAAG0,11)
            GOTO 10050
10072       CALL MESG(AAAAH0,11)
10073   GOTO 10050
10066   IF(AAAAF0.EQ.0)GOTO 10067
        IF(AAAAF0.EQ.138)GOTO 10067
        AAAAI0=AAAAF0-210
        GOTO(10069,10075,10071),AAAAI0
        AAAAI0=AAAAF0-242
        GOTO(10069,10075,10071),AAAAI0
10075     ERRCO0=18
          DOOPT=-3
10074 GOTO 10050
10076   I=I+(1)
        IF((NLINE0.EQ.0))GOTO 10077
          ERRCO0=32
          GOTO 10050
10077     IF((LIN(I).NE.138))GOTO 10079
            CALL MESG(TABSU0,1)
            DOOPT=-2
            GOTO 10080
10079       DOOPT=SETTAB(LIN(I))
            IF((DOOPT.NE.-2))GOTO 10081
              CALL SCOPY(LIN,I,TABSU0,1)
              GOTO 10082
10081         CALL SCOPY(AAAAJ0,1,TABSU0,1)
10082     CONTINUE
10080   CONTINUE
10078 GOTO 10050
10083   I=I+(1)
        IF((NLINE0.EQ.0))GOTO 10084
          ERRCO0=32
          GOTO 10050
10084     IF((LIN(I).NE.138))GOTO 10086
            CALL SAYNUM(WARNC0)
            DOOPT=-2
            GOTO 10087
10086       TEMP=CTOI(LIN,I)
            IF((LIN(I).NE.138))GOTO 10088
              IF((TEMP.LE.0))GOTO 10089
              IF((TEMP.GE.512-3))GOTO 10089
                DOOPT=-2
                WARNC0=TEMP
                GOTO 10090
10089           ERRCO0=30
10090       CONTINUE
10088     CONTINUE
10087   CONTINUE
10085 GOTO 10050
10091   I=I+(1)
        IF((NLINE0.EQ.0))GOTO 10092
          ERRCO0=32
          GOTO 10050
10092     IF((LIN(I).NE.138))GOTO 10094
            CALL SAYNUM(TSPEE0)
            DOOPT=-2
            GOTO 10095
10094       TEMP=CTOI(LIN,I)
            IF((LIN(I).NE.138))GOTO 10096
              IF((TEMP.LT.50))GOTO 10097
              IF((TEMP.GT.19200))GOTO 10097
                DOOPT=-2
                TSPEE0=TEMP
                GOTO 10098
10097           ERRCO0=30
10098       CONTINUE
10096     CONTINUE
10095   CONTINUE
10093 GOTO 10050
10099   I=I+(1)
        IF((NLINE0.EQ.0))GOTO 10100
          ERRCO0=32
          GOTO 10050
10100     IF((GETNUM(LIN,I,LINE,STAT).NE.-1))GOTO 10102
            CALL MESG(AAAAK0,10)
            IF((TOPRO0.LE.1))GOTO 10103
              TOPLN0=MAX0(1,TOPLN0-(TOPRO0-1))
              TOPRO0=1
              FIRSU0=TOPLN0
10103       DOOPT=-2
            GOTO 10104
10102       IF((STAT.EQ.-3))GOTO 10105
            IF((LIN(I).NE.138))GOTO 10105
              IF((TOPRO0+(LINE-TOPLN0+1).GE.CMDRO0))GOTO 10106
              IF((LINE-TOPLN0+1.LT.1))GOTO 10106
                TOPRO0=TOPRO0+(LINE-TOPLN0+1)
                TOPLN0=LINE+1
                DO 10107 TEMP=1,NCOLS0
                  CALL LOAD(173,TOPRO0-1,TEMP)
10107           CONTINUE
10108           IF((TOPLN0.LE.LASTL0))GOTO 10109
                  CALL ADJUS0(1,LASTL0)
10109           IF((CURLN0.GE.TOPLN0))GOTO 10110
                  CURLN0=MIN0(TOPLN0,LASTL0)
10110           DOOPT=-2
                GOTO 10111
10106           ERRCO0=17
10111       CONTINUE
10105     CONTINUE
10104   CONTINUE
10101 GOTO 10050
10112   IF((NLINE0.EQ.0))GOTO 10113
          ERRCO0=32
          GOTO 10050
10113     IF((LIN(I+1).NE.138))GOTO 10115
            ABSNO0=1+0-ABSNO0
            DOOPT=-2
10115   CONTINUE
10114 GOTO 10050
10116   IF((NLINE0.EQ.0))GOTO 10117
          ERRCO0=32
          GOTO 10050
10117     IF((LIN(I+1).NE.138))GOTO 10119
            DOOPT=-2
            INVER0=1+0-INVER0
            IF((RELAA0.NE.193))GOTO 10120
              RELAA0=225
              RELZA0=250
              GOTO 10121
10120         RELAA0=193
              RELZA0=218
10121     CONTINUE
10119   CONTINUE
10118 GOTO 10050
10122   IF((NLINE0.EQ.0))GOTO 10123
          ERRCO0=32
          GOTO 10050
10123     IF((LIN(I+1).NE.138))GOTO 10125
            IF((DDIRA0.NE.0))GOTO 10126
              CALL REMARK('>.')
              GOTO 10127
10126         CALL REMARK('<.')
10127       DOOPT=-2
            GOTO 10128
10125       IF((LIN(I+2).EQ.138))GOTO 10129
              ERRCO0=16
              GOTO 10130
10129         IF((LIN(I+1).NE.190))GOTO 10131
                DOOPT=-2
                DDIRA0=0
                GOTO 10132
10131           IF((LIN(I+1).NE.188))GOTO 10133
                  DOOPT=-2
                  DDIRA0=-1
                  GOTO 10134
10133             ERRCO0=16
10134         CONTINUE
10132       CONTINUE
10130     CONTINUE
10128   CONTINUE
10124 GOTO 10050
10135   I=I+(1)
        IF((NLINE0.EQ.0))GOTO 10136
          ERRCO0=32
          GOTO 10050
10136     IF((LIN(I).NE.138))GOTO 10138
            IF((OVERM0.NE.0))GOTO 10139
              CALL REMARK('$.')
              GOTO 10140
10139         CALL SAYNUM(OVERM0)
10140       DOOPT=-2
            GOTO 10141
10138       IF((LIN(I).NE.164))GOTO 10142
            IF((LIN(I+1).NE.138))GOTO 10142
              OVERM0=0
              DOOPT=-2
              GOTO 10143
10142         TEMP=CTOI(LIN,I)
              IF((LIN(I).NE.138))GOTO 10144
                IF((TEMP.LE.0))GOTO 10145
                IF((TEMP.GE.512))GOTO 10145
                  OVERM0=TEMP
                  DOOPT=-2
                  GOTO 10146
10145             ERRCO0=30
10146         CONTINUE
10144       CONTINUE
10143     CONTINUE
10141   CONTINUE
10137 GOTO 10050
10147   IF((NLINE0.EQ.0))GOTO 10148
          ERRCO0=32
          GOTO 10050
10148     IF((LIN(I+1).NE.138))GOTO 10150
            DOOPT=-2
            TEMPS0(1)=162
            TEMPS0(2)=UNPRI0
            TEMPS0(3)=162
            TEMPS0(4)=0
            CALL MESG(TEMPS0,1)
            GOTO 10151
10150       IF((LIN(I+2).NE.138))GOTO 10152
              IF((LIN(I+1).LT.160))GOTO 10154
              IF((LIN(I+1).GE.255))GOTO 10154
              GOTO 10153
10154           ERRCO0=30
                GOTO 10155
10153           DOOPT=-2
                IF((UNPRI0.EQ.LIN(I+1)))GOTO 10156
                  UNPRI0=LIN(I+1)
                  FIRSU0=TOPLN0
10156         CONTINUE
10155       CONTINUE
10152     CONTINUE
10151   CONTINUE
10149 GOTO 10050
10157   IF((NLINE0.EQ.0))GOTO 10158
          ERRCO0=32
          GOTO 10050
10158     IF((LIN(I+1).NE.138))GOTO 10160
            NCHOI0=0
            DOOPT=-2
            GOTO 10161
10160       IF((LIN(I+2).NE.138))GOTO 10162
            IF((LIN(I+1).EQ.174))GOTO 10163
            IF((LIN(I+1).EQ.164))GOTO 10163
            IF((LIN(I+1).EQ.163))GOTO 10163
            GOTO 10162
10163         NCHOI0=LIN(I+1)
              DOOPT=-2
              GOTO 10164
10162         IF((LIN(I+1).EQ.237))GOTO 10166
              IF((LIN(I+1).EQ.205))GOTO 10166
              GOTO 10165
10166           I=I+(1)
                IF((LIN(I+1).NE.138))GOTO 10167
                  CALL SAYNUM(FIRST0)
                  DOOPT=-2
                  GOTO 10168
10167             I=I+(1)
                  TEMP=CTOI(LIN,I)
                  IF((LIN(I).NE.138))GOTO 10169
                    IF((TEMP.LE.0))GOTO 10170
                    IF((TEMP.GE.512))GOTO 10170
                      FIRSU0=TOPLN0
                      FIRST0=TEMP
                      DOOPT=-2
                      GOTO 10171
10170                 ERRCO0=30
10171             CONTINUE
10169           CONTINUE
10168         CONTINUE
10165       CONTINUE
10164     CONTINUE
10161   CONTINUE
10159 GOTO 10050
10172   IF((NLINE0.EQ.0))GOTO 10173
          ERRCO0=32
          GOTO 10050
10173     IF((LIN(I+1).NE.138))GOTO 10175
            DOOPT=-2
            RELAA0=225
            RELZA0=250
            INVER0=1
            CALL SCOPY(AAAAL0,1,TABSU0,1)
            CALL SETTAB(TABSU0)
            WARNC0=72
10175   CONTINUE
10174 GOTO 10050
10176   IF((NLINE0.EQ.0))GOTO 10177
          ERRCO0=32
          GOTO 10050
10177     DOOPT=DOSOPT(LIN(I+1))
10178 GOTO 10050
10179   I=I+(1)
        IF((LIN(I).NE.138))GOTO 10180
          DOOPT=-2
          GOTO 10181
10180     IF((LIN(I).EQ.225))GOTO 10183
          IF((LIN(I).EQ.193))GOTO 10183
          GOTO 10182
10183     IF((LIN(I+1).NE.138))GOTO 10182
            INDEN0=0
            DOOPT=-2
            GOTO 10184
10182       TEMP=CTOI(LIN,I)
            IF((LIN(I).EQ.138))GOTO 10186
            IF((LIN(I).EQ.0))GOTO 10186
            GOTO 10185
10186         IF((TEMP.LE.0))GOTO 10187
              IF((TEMP.GE.512-2))GOTO 10187
                DOOPT=-2
                INDEN0=TEMP
                GOTO 10188
10187           ERRCO0=30
10188       CONTINUE
10185     CONTINUE
10184   CONTINUE
10181   IF((DOOPT.NE.-2))GOTO 10050
          IF((INDEN0.LE.0))GOTO 10190
            CALL SAYNUM(INDEN0)
            GOTO 10191
10190       CALL REMARK('auto.')
10191   CONTINUE
10189 GOTO 10050
10045 IF(AAAAE0.EQ.173)GOTO 10099
      AAAAM0=AAAAE0-192
      GOTO(10112,10192,10116,10122,10192,10172,10046,10091,10179,10192, 
     *    10051,10157,10057,10192,10192,10065,10192,10192,10176,10076,  
     *   10147,10135,10083,10192,10192,10192,10192,10192,10192,10192,   
     *  10192,10192,10112,10192,10116,10122,10192,10172,10046,10091,    
     * 10179,10192,10051,10157,10057,10192,10192,10065,10192,10192,10176
     *,10076,10147,10135,10083),AAAAM0
10192   ERRCO0=18
10050 IF((INVER0.NE.1))GOTO 10193
        CALL MESG(AAAAN0,3)
        GOTO 10194
10193   CALL MESG(0,3)
10194 RETURN
      END
      INTEGER FUNCTION DOSOPT(LIN)
      INTEGER LIN(1)
      COMMON /CLINES/LINE10,LINE20,NLINE0,CURLN0,LASTL0
      INTEGER LINE10,LINE20,NLINE0,CURLN0,LASTL0
      COMMON /CPAT/PATAA0(256),TLPAT0(256),SUBSA0(256),TSETA0(256)
      INTEGER PATAA0,TLPAT0,SUBSA0,TSETA0
      COMMON /CTXT/TXTAA0(512)
      INTEGER TXTAA0
      COMMON /CFILE/SAVFI0(512)
      INTEGER SAVFI0
      COMMON /CBUFR$/LASTB0,FENCE0,FREEA0,LINE00,BUFAA0(65520)
      INTEGER LASTB0,FENCE0,FREEA0,LINE00
      INTEGER BUFAA0
      INTEGER PREVL0(1),NEXTL0(1)
      INTEGER GLOBM0(1),LINEL0(1)
      INTEGER * 4 SEEKA0(1)
      INTEGER MARKN0(1)
      COMMON /CUNDO/LIMBO0,LIMCN0
      INTEGER LIMBO0,LIMCN0
      COMMON /CSCRAT/SCRAA0,SCREN0,SCRNA0(512),LOSTL0
      INTEGER SCRAA0
      INTEGER * 4 SCREN0
      INTEGER SCRNA0
      INTEGER LOSTL0
      COMMON /CMISC/BUFFE0,ERRCO0,SAVER0,PROBA0,ARGNO0,LASTC0,PEEKC0,SAV
     *CO0
      INTEGER BUFFE0,ERRCO0,SAVER0,PROBA0,ARGNO0,LASTC0
      INTEGER PEEKC0,SAVCO0(512)
      COMMON /CMARK/SAVKN0
      INTEGER SAVKN0
      COMMON /COPT/TABST0(512),TABSU0(512),UNPRI0,DDIRA0,ABSNO0,NCHOI0,O
     *VERM0,WARNC0,FIRST0,TSPEE0,INDEN0,GLOBA0
      INTEGER TABST0,TABSU0,UNPRI0
      INTEGER DDIRA0,ABSNO0,NCHOI0,OVERM0,WARNC0,FIRST0,TSPEE0,INDEN0,GL
     *OBA0
      COMMON /CTERM/TERMT0
      INTEGER TERMT0
      COMMON /CSCRN/SCREE0(128,51),MSGAL0(128),NROWS0,NCOLS0,CURRO0,CURC
     *O0,TOPRO0,BOTRO0,CMDRO0,TOPLN0,INSER0,INVER0,FIRSU0,RELAA0,RELZA0,
     *SCLEN0,SCTOP0,SCLIN0
      INTEGER SCREE0
      INTEGER MSGAL0,NROWS0,NCOLS0,CURRO0,CURCO0,TOPRO0,BOTRO0,CMDRO0,TO
     *PLN0,INSER0,INVER0,FIRSU0,RELAA0,RELZA0,SCLEN0,SCTOP0,SCLIN0(51)
      COMMON /CUNIX0/UNIXM0,BACKS0,NOTIN0,XMARK0,ESCAP0
      INTEGER UNIXM0
      INTEGER BACKS0,NOTIN0,XMARK0,ESCAP0
      COMMON /CTTY/TTYST0
      INTEGER TTYST0
      INTEGER LANG(8)
      INTEGER I
      INTEGER STRBSR
      INTEGER LPOS(7)
      INTEGER LTXT(23)
      INTEGER AAAAO0
      INTEGER AAAAP0(3)
      INTEGER AAAAQ0(4)
      INTEGER AAAAR0(11)
      EQUIVALENCE (PREVL0(1),BUFAA0(1)),(NEXTL0(1),BUFAA0(2)),(GLOBM0(1)
     *,BUFAA0(3)),(SEEKA0(1),BUFAA0(4)),(LINEL0(1),BUFAA0(6)),(MARKN0(1)
     *,BUFAA0(7))
      DATA LTXT/1,0,2,230,0,2,230,183,183,0,2,230,244,238,0,3,240,237,22
     *5,0,3,243,0/
      DATA LPOS/6,1,3,6,11,16,21/
      DATA AAAAP0/171,179,0/
      DATA AAAAQ0/183,171,179,0/
      DATA AAAAR0/177,179,160,178,178,160,179,183,171,179,0/
      I=1
      CALL GETWRD(LIN,I,LANG,8)
      IF((LIN(I).EQ.138))GOTO 10195
        DOSOPT=-3
        RETURN
10195 CALL MAPSTR(LANG,1)
      I=STRBSR(LPOS,LTXT,1,LANG)
      IF((I.NE.-1))GOTO 10196
        ERRCO0=35
        DOSOPT=-3
        RETURN
10196 AAAAO0=LTXT(LPOS(I))
      GOTO 10197
10198   WARNC0=74
        RELAA0=193
        RELZA0=218
        INVER0=0
        CALL SCOPY(AAAAP0,1,TABSU0,1)
        CALL SETTAB(TABSU0)
      GOTO 10199
10200   WARNC0=72
        RELAA0=225
        RELZA0=250
        INVER0=1
        CALL SCOPY(AAAAQ0,1,TABSU0,1)
        CALL SETTAB(TABSU0)
      GOTO 10199
10201   WARNC0=72
        RELAA0=225
        RELZA0=250
        INVER0=1
        CALL SCOPY(AAAAR0,1,TABSU0,1)
        CALL SETTAB(TABSU0)
      GOTO 10199
10197 GOTO(10198,10200,10201),AAAAO0
10199 DOSOPT=-2
      RETURN
      END
      INTEGER FUNCTION DOTLIT(SUB,ALLBUT)
      INTEGER SUB(1)
      INTEGER ALLBUT
      COMMON /CLINES/LINE10,LINE20,NLINE0,CURLN0,LASTL0
      INTEGER LINE10,LINE20,NLINE0,CURLN0,LASTL0
      COMMON /CPAT/PATAA0(256),TLPAT0(256),SUBSA0(256),TSETA0(256)
      INTEGER PATAA0,TLPAT0,SUBSA0,TSETA0
      COMMON /CTXT/TXTAA0(512)
      INTEGER TXTAA0
      COMMON /CFILE/SAVFI0(512)
      INTEGER SAVFI0
      COMMON /CBUFR$/LASTB0,FENCE0,FREEA0,LINE00,BUFAA0(65520)
      INTEGER LASTB0,FENCE0,FREEA0,LINE00
      INTEGER BUFAA0
      INTEGER PREVL0(1),NEXTL0(1)
      INTEGER GLOBM0(1),LINEL0(1)
      INTEGER * 4 SEEKA0(1)
      INTEGER MARKN0(1)
      COMMON /CUNDO/LIMBO0,LIMCN0
      INTEGER LIMBO0,LIMCN0
      COMMON /CSCRAT/SCRAA0,SCREN0,SCRNA0(512),LOSTL0
      INTEGER SCRAA0
      INTEGER * 4 SCREN0
      INTEGER SCRNA0
      INTEGER LOSTL0
      COMMON /CMISC/BUFFE0,ERRCO0,SAVER0,PROBA0,ARGNO0,LASTC0,PEEKC0,SAV
     *CO0
      INTEGER BUFFE0,ERRCO0,SAVER0,PROBA0,ARGNO0,LASTC0
      INTEGER PEEKC0,SAVCO0(512)
      COMMON /CMARK/SAVKN0
      INTEGER SAVKN0
      COMMON /COPT/TABST0(512),TABSU0(512),UNPRI0,DDIRA0,ABSNO0,NCHOI0,O
     *VERM0,WARNC0,FIRST0,TSPEE0,INDEN0,GLOBA0
      INTEGER TABST0,TABSU0,UNPRI0
      INTEGER DDIRA0,ABSNO0,NCHOI0,OVERM0,WARNC0,FIRST0,TSPEE0,INDEN0,GL
     *OBA0
      COMMON /CTERM/TERMT0
      INTEGER TERMT0
      COMMON /CSCRN/SCREE0(128,51),MSGAL0(128),NROWS0,NCOLS0,CURRO0,CURC
     *O0,TOPRO0,BOTRO0,CMDRO0,TOPLN0,INSER0,INVER0,FIRSU0,RELAA0,RELZA0,
     *SCLEN0,SCTOP0,SCLIN0
      INTEGER SCREE0
      INTEGER MSGAL0,NROWS0,NCOLS0,CURRO0,CURCO0,TOPRO0,BOTRO0,CMDRO0,TO
     *PLN0,INSER0,INVER0,FIRSU0,RELAA0,RELZA0,SCLEN0,SCTOP0,SCLIN0(51)
      COMMON /CUNIX0/UNIXM0,BACKS0,NOTIN0,XMARK0,ESCAP0
      INTEGER UNIXM0
      INTEGER BACKS0,NOTIN0,XMARK0,ESCAP0
      COMMON /CTTY/TTYST0
      INTEGER TTYST0
      INTEGER NEW(512),KNAME
      INTEGER COLLAP,X,I,J,LINE,LASTS0,STATUS
      INTEGER LENGTH,XINDEX,INJECT
      INTEGER INX
      INTEGER GETIND,GETTXT
      LOGICAL BRKFL0,INTRPT
      EQUIVALENCE (PREVL0(1),BUFAA0(1)),(NEXTL0(1),BUFAA0(2)),(GLOBM0(1)
     *,BUFAA0(3)),(SEEKA0(1),BUFAA0(4)),(LINEL0(1),BUFAA0(6)),(MARKN0(1)
     *,BUFAA0(7))
      DOTLIT=-3
      IF((LINE10.GT.0))GOTO 10202
        ERRCO0=17
        RETURN
10202 IF((FIRSU0.LE.LINE10))GOTO 10203
        FIRSU0=LINE10
10203 LASTS0=LENGTH(SUB)
      IF((LENGTH(TLPAT0).GT.LASTS0))GOTO 10205
      IF((ALLBUT.EQ.1))GOTO 10205
      GOTO 10204
10205   COLLAP=1
        GOTO 10206
10204   COLLAP=0
10206 LINE=LINE10
      GOTO 10209
10207 LINE=LINE+(1)
10209 IF((LINE.GT.LINE20))GOTO 10208
        IF((.NOT.INTRPT(BRKFL0)))GOTO 10210
          DOTLIT=-3
          RETURN
10210   INX=GETTXT(LINE)
        J=1
        I=1
        GOTO 10213
10211   I=I+(1)
10213   IF((TXTAA0(I).EQ.0))GOTO 10212
        IF((TXTAA0(I).EQ.138))GOTO 10212
          X=XINDEX(TLPAT0,TXTAA0(I),ALLBUT,LASTS0)
          IF((COLLAP.NE.1))GOTO 10214
          IF((X.LT.LASTS0))GOTO 10214
          IF((LASTS0.LE.0))GOTO 10214
            NEW(J)=SUB(LASTS0)
            J=J+(1)
            I=I+(1)
            GOTO 10217
10215       I=I+(1)
10217       IF((TXTAA0(I).EQ.0))GOTO 10216
            IF((TXTAA0(I).EQ.138))GOTO 10216
              X=XINDEX(TLPAT0,TXTAA0(I),ALLBUT,LASTS0)
              IF((X.GE.LASTS0))GOTO 10215
                GOTO 10216
10216     CONTINUE
10214     IF((TXTAA0(I).EQ.0))GOTO 10212
          IF((TXTAA0(I).EQ.138))GOTO 10212
          GOTO 10219
10219     IF((X.LE.0))GOTO 10221
          IF((LASTS0.LE.0))GOTO 10221
            NEW(J)=SUB(X)
            J=J+(1)
            GOTO 10211
10221       IF((X.NE.0))GOTO 10223
              NEW(J)=TXTAA0(I)
              J=J+(1)
10223     CONTINUE
10222   GOTO 10211
10212   IF((TXTAA0(I).NE.138))GOTO 10224
          NEW(J)=138
          J=J+(1)
10224   NEW(J)=0
        KNAME=MARKN0(INX)
        CALL DELETE(LINE,LINE,STATUS)
        DOTLIT=INJECT(NEW)
        IF((DOTLIT.NE.-3))GOTO 10225
          GOTO 10208
10225   INX=GETIND(CURLN0)
        MARKN0(INX)=KNAME
        DOTLIT=-2
        BUFFE0=1
      GOTO 10207
10208 RETURN
      END
      INTEGER FUNCTION GETRA0(ARRAY,K,SET,SIZE,ALLBUT)
      INTEGER ARRAY(1),SET(1)
      INTEGER K,SIZE,ALLBUT
      COMMON /CLINES/LINE10,LINE20,NLINE0,CURLN0,LASTL0
      INTEGER LINE10,LINE20,NLINE0,CURLN0,LASTL0
      COMMON /CPAT/PATAA0(256),TLPAT0(256),SUBSA0(256),TSETA0(256)
      INTEGER PATAA0,TLPAT0,SUBSA0,TSETA0
      COMMON /CTXT/TXTAA0(512)
      INTEGER TXTAA0
      COMMON /CFILE/SAVFI0(512)
      INTEGER SAVFI0
      COMMON /CBUFR$/LASTB0,FENCE0,FREEA0,LINE00,BUFAA0(65520)
      INTEGER LASTB0,FENCE0,FREEA0,LINE00
      INTEGER BUFAA0
      INTEGER PREVL0(1),NEXTL0(1)
      INTEGER GLOBM0(1),LINEL0(1)
      INTEGER * 4 SEEKA0(1)
      INTEGER MARKN0(1)
      COMMON /CUNDO/LIMBO0,LIMCN0
      INTEGER LIMBO0,LIMCN0
      COMMON /CSCRAT/SCRAA0,SCREN0,SCRNA0(512),LOSTL0
      INTEGER SCRAA0
      INTEGER * 4 SCREN0
      INTEGER SCRNA0
      INTEGER LOSTL0
      COMMON /CMISC/BUFFE0,ERRCO0,SAVER0,PROBA0,ARGNO0,LASTC0,PEEKC0,SAV
     *CO0
      INTEGER BUFFE0,ERRCO0,SAVER0,PROBA0,ARGNO0,LASTC0
      INTEGER PEEKC0,SAVCO0(512)
      COMMON /CMARK/SAVKN0
      INTEGER SAVKN0
      COMMON /COPT/TABST0(512),TABSU0(512),UNPRI0,DDIRA0,ABSNO0,NCHOI0,O
     *VERM0,WARNC0,FIRST0,TSPEE0,INDEN0,GLOBA0
      INTEGER TABST0,TABSU0,UNPRI0
      INTEGER DDIRA0,ABSNO0,NCHOI0,OVERM0,WARNC0,FIRST0,TSPEE0,INDEN0,GL
     *OBA0
      COMMON /CTERM/TERMT0
      INTEGER TERMT0
      COMMON /CSCRN/SCREE0(128,51),MSGAL0(128),NROWS0,NCOLS0,CURRO0,CURC
     *O0,TOPRO0,BOTRO0,CMDRO0,TOPLN0,INSER0,INVER0,FIRSU0,RELAA0,RELZA0,
     *SCLEN0,SCTOP0,SCLIN0
      INTEGER SCREE0
      INTEGER MSGAL0,NROWS0,NCOLS0,CURRO0,CURCO0,TOPRO0,BOTRO0,CMDRO0,TO
     *PLN0,INSER0,INVER0,FIRSU0,RELAA0,RELZA0,SCLEN0,SCTOP0,SCLIN0(51)
      COMMON /CUNIX0/UNIXM0,BACKS0,NOTIN0,XMARK0,ESCAP0
      INTEGER UNIXM0
      INTEGER BACKS0,NOTIN0,XMARK0,ESCAP0
      COMMON /CTTY/TTYST0
      INTEGER TTYST0
      INTEGER I,J
      INTEGER ADDSET
      EQUIVALENCE (PREVL0(1),BUFAA0(1)),(NEXTL0(1),BUFAA0(2)),(GLOBM0(1)
     *,BUFAA0(3)),(SEEKA0(1),BUFAA0(4)),(LINEL0(1),BUFAA0(6)),(MARKN0(1)
     *,BUFAA0(7))
      ERRCO0=28
      I=K+1
      IF((ARRAY(I).NE.254))GOTO 10226
        ALLBUT=1
        I=I+(1)
        GOTO 10227
10226   ALLBUT=0
10227 J=1
      GETRA0=-3
      CALL FILSET(ARRAY(K),ARRAY,I,SET,J,SIZE)
      IF((ARRAY(I).EQ.ARRAY(K)))GOTO 10228
        SET(1)=0
        RETURN
10228 IF((SET(1).NE.0))GOTO 10229
        ERRCO0=29
        RETURN
10229 IF((J.LE.1))GOTO 10230
      IF((ADDSET(0,SET,J,SIZE).NE.0))GOTO 10230
        SET(1)=0
        RETURN
10230 K=I
      ERRCO0=7
      GETRA0=-2
      RETURN
      END
      INTEGER FUNCTION XINDEX(ARRAY,C,ALLBUT,LASTTO)
      INTEGER ARRAY(1),C
      INTEGER ALLBUT,LASTTO
      INTEGER INDEX
      IF((C.NE.0))GOTO 10231
        XINDEX=0
        GOTO 10232
10231   IF((ALLBUT.NE.0))GOTO 10233
          XINDEX=INDEX(ARRAY,C)
          GOTO 10234
10233     IF((INDEX(ARRAY,C).LE.0))GOTO 10235
            XINDEX=0
            GOTO 10236
10235       XINDEX=LASTTO+1
10236   CONTINUE
10234 CONTINUE
10232 RETURN
      END
      INTEGER FUNCTION MAKSET(ARRAY,K,SET,SIZE)
      INTEGER ARRAY(1),SET(1)
      INTEGER K,SIZE
      COMMON /CLINES/LINE10,LINE20,NLINE0,CURLN0,LASTL0
      INTEGER LINE10,LINE20,NLINE0,CURLN0,LASTL0
      COMMON /CPAT/PATAA0(256),TLPAT0(256),SUBSA0(256),TSETA0(256)
      INTEGER PATAA0,TLPAT0,SUBSA0,TSETA0
      COMMON /CTXT/TXTAA0(512)
      INTEGER TXTAA0
      COMMON /CFILE/SAVFI0(512)
      INTEGER SAVFI0
      COMMON /CBUFR$/LASTB0,FENCE0,FREEA0,LINE00,BUFAA0(65520)
      INTEGER LASTB0,FENCE0,FREEA0,LINE00
      INTEGER BUFAA0
      INTEGER PREVL0(1),NEXTL0(1)
      INTEGER GLOBM0(1),LINEL0(1)
      INTEGER * 4 SEEKA0(1)
      INTEGER MARKN0(1)
      COMMON /CUNDO/LIMBO0,LIMCN0
      INTEGER LIMBO0,LIMCN0
      COMMON /CSCRAT/SCRAA0,SCREN0,SCRNA0(512),LOSTL0
      INTEGER SCRAA0
      INTEGER * 4 SCREN0
      INTEGER SCRNA0
      INTEGER LOSTL0
      COMMON /CMISC/BUFFE0,ERRCO0,SAVER0,PROBA0,ARGNO0,LASTC0,PEEKC0,SAV
     *CO0
      INTEGER BUFFE0,ERRCO0,SAVER0,PROBA0,ARGNO0,LASTC0
      INTEGER PEEKC0,SAVCO0(512)
      COMMON /CMARK/SAVKN0
      INTEGER SAVKN0
      COMMON /COPT/TABST0(512),TABSU0(512),UNPRI0,DDIRA0,ABSNO0,NCHOI0,O
     *VERM0,WARNC0,FIRST0,TSPEE0,INDEN0,GLOBA0
      INTEGER TABST0,TABSU0,UNPRI0
      INTEGER DDIRA0,ABSNO0,NCHOI0,OVERM0,WARNC0,FIRST0,TSPEE0,INDEN0,GL
     *OBA0
      COMMON /CTERM/TERMT0
      INTEGER TERMT0
      COMMON /CSCRN/SCREE0(128,51),MSGAL0(128),NROWS0,NCOLS0,CURRO0,CURC
     *O0,TOPRO0,BOTRO0,CMDRO0,TOPLN0,INSER0,INVER0,FIRSU0,RELAA0,RELZA0,
     *SCLEN0,SCTOP0,SCLIN0
      INTEGER SCREE0
      INTEGER MSGAL0,NROWS0,NCOLS0,CURRO0,CURCO0,TOPRO0,BOTRO0,CMDRO0,TO
     *PLN0,INSER0,INVER0,FIRSU0,RELAA0,RELZA0,SCLEN0,SCTOP0,SCLIN0(51)
      COMMON /CUNIX0/UNIXM0,BACKS0,NOTIN0,XMARK0,ESCAP0
      INTEGER UNIXM0
      INTEGER BACKS0,NOTIN0,XMARK0,ESCAP0
      COMMON /CTTY/TTYST0
      INTEGER TTYST0
      INTEGER I,J,L
      INTEGER ADDSET
      INTEGER SAVED0
      EQUIVALENCE (PREVL0(1),BUFAA0(1)),(NEXTL0(1),BUFAA0(2)),(GLOBM0(1)
     *,BUFAA0(3)),(SEEKA0(1),BUFAA0(4)),(LINEL0(1),BUFAA0(6)),(MARKN0(1)
     *,BUFAA0(7))
      IF((UNIXM0.NE.0))GOTO 10237
        SAVED0=166
        GOTO 10238
10237   SAVED0=165
10238 MAKSET=-3
      ERRCO0=28
      IF((ARRAY(K).NE.0))GOTO 10239
        RETURN
10239 IF((ARRAY(K+1).NE.SAVED0))GOTO 10240
      IF((ARRAY(K+2).EQ.ARRAY(K)))GOTO 10241
      IF((ARRAY(K+2).EQ.138))GOTO 10241
      GOTO 10240
10241   CALL CTOC(TSETA0,SET,256)
        K=K+(2)
        IF((ARRAY(K).NE.138))GOTO 10243
          ARRAY(K)=ARRAY(K-2)
          ARRAY(K+1)=138
          ARRAY(K+2)=0
          PEEKC0=143
10242   GOTO 10243
10240   L=K
        GOTO 10246
10244   L=L+(1)
10246   IF((ARRAY(L).EQ.0))GOTO 10245
        GOTO 10244
10245   L=L-(2)
        IF((L.NE.K))GOTO 10247
          ARRAY(K+1)=ARRAY(K)
          ARRAY(K+2)=138
          ARRAY(K+3)=0
          PEEKC0=143
          GOTO 10248
10247     IF((ARRAY(L).EQ.240))GOTO 10250
          IF((ARRAY(L).EQ.208))GOTO 10250
          GOTO 10249
10250       L=L-(1)
            IF((L.LT.K+1))GOTO 10251
            IF((ARRAY(L).NE.ARRAY(K)))GOTO 10251
            IF((ARRAY(L-1).NE.ESCAP0))GOTO 10254
            IF((ARRAY(L-2).EQ.ESCAP0))GOTO 10254
            GOTO 10251
10251         L=L+(2)
              ARRAY(L)=ARRAY(K)
              ARRAY(L+1)=138
              ARRAY(L+2)=0
              PEEKC0=143
10253       GOTO 10254
10249       IF((ARRAY(L).NE.ARRAY(K)))GOTO 10256
            IF((ARRAY(L-1).NE.ESCAP0))GOTO 10255
            IF((ARRAY(L-2).EQ.ESCAP0))GOTO 10255
            GOTO 10256
10256         L=L+(1)
              ARRAY(L)=ARRAY(K)
              ARRAY(L+1)=138
              ARRAY(L+2)=0
              PEEKC0=143
10255     CONTINUE
10254   CONTINUE
10248   J=1
        I=K+1
        CALL FILSET(ARRAY(K),ARRAY,I,SET,J,SIZE)
        IF((ARRAY(I).EQ.ARRAY(K)))GOTO 10258
          RETURN
10258   IF((ADDSET(0,SET,J,SIZE).NE.0))GOTO 10259
          RETURN
10259   CALL CTOC(SET,TSETA0,256)
        K=I
10243 ERRCO0=7
      MAKSET=-2
      RETURN
      END
      INTEGER FUNCTION DOUNDO(DFLG,STATUS)
      INTEGER STATUS,DFLG
      COMMON /CLINES/LINE10,LINE20,NLINE0,CURLN0,LASTL0
      INTEGER LINE10,LINE20,NLINE0,CURLN0,LASTL0
      COMMON /CPAT/PATAA0(256),TLPAT0(256),SUBSA0(256),TSETA0(256)
      INTEGER PATAA0,TLPAT0,SUBSA0,TSETA0
      COMMON /CTXT/TXTAA0(512)
      INTEGER TXTAA0
      COMMON /CFILE/SAVFI0(512)
      INTEGER SAVFI0
      COMMON /CBUFR$/LASTB0,FENCE0,FREEA0,LINE00,BUFAA0(65520)
      INTEGER LASTB0,FENCE0,FREEA0,LINE00
      INTEGER BUFAA0
      INTEGER PREVL0(1),NEXTL0(1)
      INTEGER GLOBM0(1),LINEL0(1)
      INTEGER * 4 SEEKA0(1)
      INTEGER MARKN0(1)
      COMMON /CUNDO/LIMBO0,LIMCN0
      INTEGER LIMBO0,LIMCN0
      COMMON /CSCRAT/SCRAA0,SCREN0,SCRNA0(512),LOSTL0
      INTEGER SCRAA0
      INTEGER * 4 SCREN0
      INTEGER SCRNA0
      INTEGER LOSTL0
      COMMON /CMISC/BUFFE0,ERRCO0,SAVER0,PROBA0,ARGNO0,LASTC0,PEEKC0,SAV
     *CO0
      INTEGER BUFFE0,ERRCO0,SAVER0,PROBA0,ARGNO0,LASTC0
      INTEGER PEEKC0,SAVCO0(512)
      COMMON /CMARK/SAVKN0
      INTEGER SAVKN0
      COMMON /COPT/TABST0(512),TABSU0(512),UNPRI0,DDIRA0,ABSNO0,NCHOI0,O
     *VERM0,WARNC0,FIRST0,TSPEE0,INDEN0,GLOBA0
      INTEGER TABST0,TABSU0,UNPRI0
      INTEGER DDIRA0,ABSNO0,NCHOI0,OVERM0,WARNC0,FIRST0,TSPEE0,INDEN0,GL
     *OBA0
      COMMON /CTERM/TERMT0
      INTEGER TERMT0
      COMMON /CSCRN/SCREE0(128,51),MSGAL0(128),NROWS0,NCOLS0,CURRO0,CURC
     *O0,TOPRO0,BOTRO0,CMDRO0,TOPLN0,INSER0,INVER0,FIRSU0,RELAA0,RELZA0,
     *SCLEN0,SCTOP0,SCLIN0
      INTEGER SCREE0
      INTEGER MSGAL0,NROWS0,NCOLS0,CURRO0,CURCO0,TOPRO0,BOTRO0,CMDRO0,TO
     *PLN0,INSER0,INVER0,FIRSU0,RELAA0,RELZA0,SCLEN0,SCTOP0,SCLIN0(51)
      COMMON /CUNIX0/UNIXM0,BACKS0,NOTIN0,XMARK0,ESCAP0
      INTEGER UNIXM0
      INTEGER BACKS0,NOTIN0,XMARK0,ESCAP0
      COMMON /CTTY/TTYST0
      INTEGER TTYST0
      INTEGER L1,L2,OLDCNT
      INTEGER NEXTLN
      INTEGER K1,K2
      INTEGER GETIND
      EQUIVALENCE (PREVL0(1),BUFAA0(1)),(NEXTL0(1),BUFAA0(2)),(GLOBM0(1)
     *,BUFAA0(3)),(SEEKA0(1),BUFAA0(4)),(LINEL0(1),BUFAA0(6)),(MARKN0(1)
     *,BUFAA0(7))
      STATUS=-3
      IF((DFLG.NE.0))GOTO 10260
      IF((LINE10.GT.0))GOTO 10260
        ERRCO0=17
        GOTO 10261
10260   IF((LIMBO0.NE.-1))GOTO 10262
          ERRCO0=15
          GOTO 10263
10262     IF((LINE10.LE.LINE20))GOTO 10264
            ERRCO0=1
            GOTO 10265
10264       IF((LINE20.LE.LASTL0))GOTO 10266
              ERRCO0=23
              GOTO 10267
10266         STATUS=-2
              CURLN0=LINE20
              K1=GETIND(LINE20)
              K2=GETIND(NEXTLN(LINE20))
              L1=LIMBO0
              L2=PREVL0(L1)
              CALL RELINK(K1,L1,L2,K2)
              CALL RELINK(L2,K2,K1,L1)
              CALL SVINS(LINE20,LIMCN0)
              OLDCNT=LIMCN0
              LIMCN0=0
              LIMBO0=-1
              LASTL0=LASTL0+OLDCNT
              IF((DFLG.NE.0))GOTO 10268
                CALL DELETE(LINE10,LINE20,STATUS)
10268         CURLN0=CURLN0+(OLDCNT)
              IF((FIRSU0.LE.LINE10))GOTO 10269
                FIRSU0=LINE10
10269       CONTINUE
10267     CONTINUE
10265   CONTINUE
10263 CONTINUE
10261 DOUNDO=STATUS
      RETURN
      END
      INTEGER FUNCTION DRAWB0(LIN,I)
      INTEGER LIN(1)
      INTEGER I
      COMMON /CLINES/LINE10,LINE20,NLINE0,CURLN0,LASTL0
      INTEGER LINE10,LINE20,NLINE0,CURLN0,LASTL0
      COMMON /CPAT/PATAA0(256),TLPAT0(256),SUBSA0(256),TSETA0(256)
      INTEGER PATAA0,TLPAT0,SUBSA0,TSETA0
      COMMON /CTXT/TXTAA0(512)
      INTEGER TXTAA0
      COMMON /CFILE/SAVFI0(512)
      INTEGER SAVFI0
      COMMON /CBUFR$/LASTB0,FENCE0,FREEA0,LINE00,BUFAA0(65520)
      INTEGER LASTB0,FENCE0,FREEA0,LINE00
      INTEGER BUFAA0
      INTEGER PREVL0(1),NEXTL0(1)
      INTEGER GLOBM0(1),LINEL0(1)
      INTEGER * 4 SEEKA0(1)
      INTEGER MARKN0(1)
      COMMON /CUNDO/LIMBO0,LIMCN0
      INTEGER LIMBO0,LIMCN0
      COMMON /CSCRAT/SCRAA0,SCREN0,SCRNA0(512),LOSTL0
      INTEGER SCRAA0
      INTEGER * 4 SCREN0
      INTEGER SCRNA0
      INTEGER LOSTL0
      COMMON /CMISC/BUFFE0,ERRCO0,SAVER0,PROBA0,ARGNO0,LASTC0,PEEKC0,SAV
     *CO0
      INTEGER BUFFE0,ERRCO0,SAVER0,PROBA0,ARGNO0,LASTC0
      INTEGER PEEKC0,SAVCO0(512)
      COMMON /CMARK/SAVKN0
      INTEGER SAVKN0
      COMMON /COPT/TABST0(512),TABSU0(512),UNPRI0,DDIRA0,ABSNO0,NCHOI0,O
     *VERM0,WARNC0,FIRST0,TSPEE0,INDEN0,GLOBA0
      INTEGER TABST0,TABSU0,UNPRI0
      INTEGER DDIRA0,ABSNO0,NCHOI0,OVERM0,WARNC0,FIRST0,TSPEE0,INDEN0,GL
     *OBA0
      COMMON /CTERM/TERMT0
      INTEGER TERMT0
      COMMON /CSCRN/SCREE0(128,51),MSGAL0(128),NROWS0,NCOLS0,CURRO0,CURC
     *O0,TOPRO0,BOTRO0,CMDRO0,TOPLN0,INSER0,INVER0,FIRSU0,RELAA0,RELZA0,
     *SCLEN0,SCTOP0,SCLIN0
      INTEGER SCREE0
      INTEGER MSGAL0,NROWS0,NCOLS0,CURRO0,CURCO0,TOPRO0,BOTRO0,CMDRO0,TO
     *PLN0,INSER0,INVER0,FIRSU0,RELAA0,RELZA0,SCLEN0,SCTOP0,SCLIN0(51)
      COMMON /CUNIX0/UNIXM0,BACKS0,NOTIN0,XMARK0,ESCAP0
      INTEGER UNIXM0
      INTEGER BACKS0,NOTIN0,XMARK0,ESCAP0
      COMMON /CTTY/TTYST0
      INTEGER TTYST0
      INTEGER LEFT,RIGHT,COL,LEN,JUNK
      INTEGER CTOI,EQUAL,INJECT,DELETE
      INTEGER INDEX,GETIND,GETTXT
      INTEGER TEXT(512),KNAME,CH
      EQUIVALENCE (PREVL0(1),BUFAA0(1)),(NEXTL0(1),BUFAA0(2)),(GLOBM0(1)
     *,BUFAA0(3)),(SEEKA0(1),BUFAA0(4)),(LINEL0(1),BUFAA0(6)),(MARKN0(1)
     *,BUFAA0(7))
      LEFT=CTOI(LIN,I)
      IF((LEFT.LE.0))GOTO 10271
      IF((LEFT.GE.512-2))GOTO 10271
      GOTO 10270
10271   ERRCO0=34
        DRAWB0=-3
        RETURN
10270 IF((LIN(I).NE.172))GOTO 10272
        I=I+(1)
10273   IF((LIN(I).NE.160))GOTO 10274
          I=I+(1)
        GOTO 10273
10274   RIGHT=CTOI(LIN,I)
        IF((RIGHT.LE.0))GOTO 10276
        IF((RIGHT.GE.512-2))GOTO 10276
        IF((LEFT.GT.RIGHT))GOTO 10276
        GOTO 10277
10276     ERRCO0=34
          DRAWB0=-3
          RETURN
10272   RIGHT=LEFT
10277 CONTINUE
10278 IF((LIN(I).NE.160))GOTO 10279
        I=I+(1)
      GOTO 10278
10279 IF((LIN(I).NE.138))GOTO 10280
        CH=160
        GOTO 10281
10280   CH=LIN(I)
        I=I+(1)
10281 IF((LIN(I).EQ.138))GOTO 10282
        ERRCO0=7
        DRAWB0=-3
        RETURN
10282 IF((LINE10.GT.0))GOTO 10283
        ERRCO0=17
        DRAWB0=-3
        RETURN
10283 CURLN0=LINE10
      GOTO 10286
10284 CURLN0=CURLN0+(1)
10286 IF((CURLN0.GT.LINE20))GOTO 10285
        INDEX=GETTXT(CURLN0)
        LEN=LINEL0(INDEX)
        CALL MOVE$(TXTAA0,TEXT,LEN)
        IF((TEXT(LEN-1).NE.138))GOTO 10287
          COL=LEN-1
          GOTO 10288
10287     COL=LEN
10288   CONTINUE
10289   IF((COL.GT.RIGHT))GOTO 10290
          TEXT(COL)=160
          COL=COL+(1)
        GOTO 10289
10290   TEXT(COL)=138
        TEXT(COL+1)=0
        IF((CURLN0.EQ.LINE10))GOTO 10292
        IF((CURLN0.EQ.LINE20))GOTO 10292
        GOTO 10291
10292     COL=LEFT
          GOTO 10295
10293     COL=COL+(1)
10295     IF((COL.GT.RIGHT))GOTO 10296
            TEXT(COL)=CH
          GOTO 10293
10291     TEXT(LEFT)=CH
          TEXT(RIGHT)=CH
10296   IF((EQUAL(TEXT,TXTAA0).NE.0))GOTO 10284
          KNAME=MARKN0(INDEX)
          IF((DELETE(CURLN0,CURLN0,JUNK).EQ.-3))GOTO 10299
          IF((INJECT(TEXT).EQ.-3))GOTO 10299
          GOTO 10298
10299       DRAWB0=-3
            RETURN
10298     INDEX=GETIND(CURLN0)
          MARKN0(INDEX)=KNAME
          BUFFE0=1
10297 GOTO 10284
10285 CURLN0=LINE10
      IF((FIRSU0.LE.CURLN0))GOTO 10300
        FIRSU0=CURLN0
10300 CALL ADJUS0(CURLN0,CURLN0)
      CALL UPDSC0
      DRAWB0=-2
      RETURN
      END
      INTEGER FUNCTION GETSTR(LIN,I,DST,MAXDST)
      INTEGER LIN(512),DST(MAXDST)
      INTEGER I,MAXDST
      COMMON /CLINES/LINE10,LINE20,NLINE0,CURLN0,LASTL0
      INTEGER LINE10,LINE20,NLINE0,CURLN0,LASTL0
      COMMON /CPAT/PATAA0(256),TLPAT0(256),SUBSA0(256),TSETA0(256)
      INTEGER PATAA0,TLPAT0,SUBSA0,TSETA0
      COMMON /CTXT/TXTAA0(512)
      INTEGER TXTAA0
      COMMON /CFILE/SAVFI0(512)
      INTEGER SAVFI0
      COMMON /CBUFR$/LASTB0,FENCE0,FREEA0,LINE00,BUFAA0(65520)
      INTEGER LASTB0,FENCE0,FREEA0,LINE00
      INTEGER BUFAA0
      INTEGER PREVL0(1),NEXTL0(1)
      INTEGER GLOBM0(1),LINEL0(1)
      INTEGER * 4 SEEKA0(1)
      INTEGER MARKN0(1)
      COMMON /CUNDO/LIMBO0,LIMCN0
      INTEGER LIMBO0,LIMCN0
      COMMON /CSCRAT/SCRAA0,SCREN0,SCRNA0(512),LOSTL0
      INTEGER SCRAA0
      INTEGER * 4 SCREN0
      INTEGER SCRNA0
      INTEGER LOSTL0
      COMMON /CMISC/BUFFE0,ERRCO0,SAVER0,PROBA0,ARGNO0,LASTC0,PEEKC0,SAV
     *CO0
      INTEGER BUFFE0,ERRCO0,SAVER0,PROBA0,ARGNO0,LASTC0
      INTEGER PEEKC0,SAVCO0(512)
      COMMON /CMARK/SAVKN0
      INTEGER SAVKN0
      COMMON /COPT/TABST0(512),TABSU0(512),UNPRI0,DDIRA0,ABSNO0,NCHOI0,O
     *VERM0,WARNC0,FIRST0,TSPEE0,INDEN0,GLOBA0
      INTEGER TABST0,TABSU0,UNPRI0
      INTEGER DDIRA0,ABSNO0,NCHOI0,OVERM0,WARNC0,FIRST0,TSPEE0,INDEN0,GL
     *OBA0
      COMMON /CTERM/TERMT0
      INTEGER TERMT0
      COMMON /CSCRN/SCREE0(128,51),MSGAL0(128),NROWS0,NCOLS0,CURRO0,CURC
     *O0,TOPRO0,BOTRO0,CMDRO0,TOPLN0,INSER0,INVER0,FIRSU0,RELAA0,RELZA0,
     *SCLEN0,SCTOP0,SCLIN0
      INTEGER SCREE0
      INTEGER MSGAL0,NROWS0,NCOLS0,CURRO0,CURCO0,TOPRO0,BOTRO0,CMDRO0,TO
     *PLN0,INSER0,INVER0,FIRSU0,RELAA0,RELZA0,SCLEN0,SCTOP0,SCLIN0(51)
      COMMON /CUNIX0/UNIXM0,BACKS0,NOTIN0,XMARK0,ESCAP0
      INTEGER UNIXM0
      INTEGER BACKS0,NOTIN0,XMARK0,ESCAP0
      COMMON /CTTY/TTYST0
      INTEGER TTYST0
      INTEGER DELIM
      INTEGER ESC
      INTEGER J,K,D
      EQUIVALENCE (PREVL0(1),BUFAA0(1)),(NEXTL0(1),BUFAA0(2)),(GLOBM0(1)
     *,BUFAA0(3)),(SEEKA0(1),BUFAA0(4)),(LINEL0(1),BUFAA0(6)),(MARKN0(1)
     *,BUFAA0(7))
      J=I
      GETSTR=-3
      ERRCO0=4
      DELIM=LIN(J)
      IF((DELIM.NE.138))GOTO 10301
        LIN(J)=175
        LIN(J+1)=160
        LIN(J+2)=175
        LIN(J+3)=138
        LIN(J+4)=0
        DELIM=LIN(J)
        PEEKC0=143
        GOTO 10302
10301   IF((DELIM.EQ.240))GOTO 10304
        IF((DELIM.EQ.208))GOTO 10304
        GOTO 10303
10304   IF((LIN(J+1).NE.138))GOTO 10303
          LIN(J)=175
          LIN(J+1)=160
          LIN(J+2)=175
          LIN(J+3)=DELIM
          LIN(J+4)=138
          LIN(J+5)=0
          DELIM=LIN(J)
          PEEKC0=143
10303 CONTINUE
10302 IF((LIN(J+1).NE.138))GOTO 10305
        DST(1)=0
        ERRCO0=14
        GETSTR=-2
        RETURN
10305 K=J+1
      GOTO 10308
10306 K=K+(1)
10308 IF((LIN(K).EQ.138))GOTO 10307
      GOTO 10306
10307 K=K-(1)
      IF((LIN(K).EQ.240))GOTO 10310
      IF((LIN(K).EQ.208))GOTO 10310
      GOTO 10309
10310   K=K-(1)
        IF((LIN(K).NE.DELIM))GOTO 10311
        IF((LIN(K-1).NE.ESCAP0))GOTO 10314
        IF((LIN(K-2).EQ.ESCAP0))GOTO 10314
        GOTO 10311
10311     K=K+(2)
          LIN(K)=DELIM
          LIN(K+1)=138
          LIN(K+2)=0
          PEEKC0=143
10313   GOTO 10314
10309   IF((LIN(K).NE.DELIM))GOTO 10316
        IF((LIN(K-1).NE.ESCAP0))GOTO 10315
        IF((LIN(K-2).EQ.ESCAP0))GOTO 10315
        GOTO 10316
10316     K=K+(1)
          LIN(K)=DELIM
          LIN(K+1)=138
          LIN(K+2)=0
          PEEKC0=143
10315 CONTINUE
10314 K=J+1
      GOTO 10320
10318 K=K+(1)
10320 IF((LIN(K).EQ.DELIM))GOTO 10319
        IF((LIN(K).EQ.138))GOTO 10322
        IF((LIN(K).EQ.0))GOTO 10322
        GOTO 10321
10322     IF((DELIM.NE.160))GOTO 10323
            GOTO 10319
10323       RETURN
10321   CALL ESC(LIN,K)
      GOTO 10318
10319 IF((K-J.LE.MAXDST))GOTO 10324
        RETURN
10324 D=1
      J=J+(1)
      GOTO 10327
10325 D=D+(1)
      J=J+(1)
10327 IF((J.GE.K))GOTO 10326
        DST(D)=ESC(LIN,J)
      GOTO 10325
10326 DST(D)=0
      I=J
      ERRCO0=7
      GETSTR=-2
      RETURN
      END
      INTEGER FUNCTION GETWRD(LINE,I,WORD,SIZE)
      INTEGER I,SIZE
      INTEGER LINE(1),WORD(SIZE)
      INTEGER J
10328 IF((LINE(I).NE.160))GOTO 10329
        I=I+(1)
      GOTO 10328
10329 J=1
10330 IF((LINE(I).EQ.160))GOTO 10331
      IF((LINE(I).EQ.138))GOTO 10331
      IF((LINE(I).EQ.0))GOTO 10331
        IF((J.GE.SIZE))GOTO 10332
          WORD(J)=LINE(I)
          J=J+(1)
10332   I=I+(1)
      GOTO 10330
10331 WORD(J)=0
      GETWRD=J-1
      RETURN
      END
      INTEGER FUNCTION JOIN(SUB)
      INTEGER SUB(1)
      COMMON /CLINES/LINE10,LINE20,NLINE0,CURLN0,LASTL0
      INTEGER LINE10,LINE20,NLINE0,CURLN0,LASTL0
      COMMON /CPAT/PATAA0(256),TLPAT0(256),SUBSA0(256),TSETA0(256)
      INTEGER PATAA0,TLPAT0,SUBSA0,TSETA0
      COMMON /CTXT/TXTAA0(512)
      INTEGER TXTAA0
      COMMON /CFILE/SAVFI0(512)
      INTEGER SAVFI0
      COMMON /CBUFR$/LASTB0,FENCE0,FREEA0,LINE00,BUFAA0(65520)
      INTEGER LASTB0,FENCE0,FREEA0,LINE00
      INTEGER BUFAA0
      INTEGER PREVL0(1),NEXTL0(1)
      INTEGER GLOBM0(1),LINEL0(1)
      INTEGER * 4 SEEKA0(1)
      INTEGER MARKN0(1)
      COMMON /CUNDO/LIMBO0,LIMCN0
      INTEGER LIMBO0,LIMCN0
      COMMON /CSCRAT/SCRAA0,SCREN0,SCRNA0(512),LOSTL0
      INTEGER SCRAA0
      INTEGER * 4 SCREN0
      INTEGER SCRNA0
      INTEGER LOSTL0
      COMMON /CMISC/BUFFE0,ERRCO0,SAVER0,PROBA0,ARGNO0,LASTC0,PEEKC0,SAV
     *CO0
      INTEGER BUFFE0,ERRCO0,SAVER0,PROBA0,ARGNO0,LASTC0
      INTEGER PEEKC0,SAVCO0(512)
      COMMON /CMARK/SAVKN0
      INTEGER SAVKN0
      COMMON /COPT/TABST0(512),TABSU0(512),UNPRI0,DDIRA0,ABSNO0,NCHOI0,O
     *VERM0,WARNC0,FIRST0,TSPEE0,INDEN0,GLOBA0
      INTEGER TABST0,TABSU0,UNPRI0
      INTEGER DDIRA0,ABSNO0,NCHOI0,OVERM0,WARNC0,FIRST0,TSPEE0,INDEN0,GL
     *OBA0
      COMMON /CTERM/TERMT0
      INTEGER TERMT0
      COMMON /CSCRN/SCREE0(128,51),MSGAL0(128),NROWS0,NCOLS0,CURRO0,CURC
     *O0,TOPRO0,BOTRO0,CMDRO0,TOPLN0,INSER0,INVER0,FIRSU0,RELAA0,RELZA0,
     *SCLEN0,SCTOP0,SCLIN0
      INTEGER SCREE0
      INTEGER MSGAL0,NROWS0,NCOLS0,CURRO0,CURCO0,TOPRO0,BOTRO0,CMDRO0,TO
     *PLN0,INSER0,INVER0,FIRSU0,RELAA0,RELZA0,SCLEN0,SCTOP0,SCLIN0(51)
      COMMON /CUNIX0/UNIXM0,BACKS0,NOTIN0,XMARK0,ESCAP0
      INTEGER UNIXM0
      INTEGER BACKS0,NOTIN0,XMARK0,ESCAP0
      COMMON /CTTY/TTYST0
      INTEGER TTYST0
      INTEGER NEW(512)
      INTEGER L,LINE,SUBLEN
      INTEGER INJECT,DELETE,LENGTH
      INTEGER K
      INTEGER GETIND
      LOGICAL INTRPT,BRKFL0
      EQUIVALENCE (PREVL0(1),BUFAA0(1)),(NEXTL0(1),BUFAA0(2)),(GLOBM0(1)
     *,BUFAA0(3)),(SEEKA0(1),BUFAA0(4)),(LINEL0(1),BUFAA0(6)),(MARKN0(1)
     *,BUFAA0(7))
      JOIN=-3
      IF((LINE10.GT.0))GOTO 10333
        ERRCO0=17
        RETURN
10333 SUBLEN=LENGTH(SUB)+1
      LINE=LINE10
      K=GETIND(LINE)
      CALL GTXT(K)
      CALL MOVE$(TXTAA0,NEW,LINEL0(K))
      L=LINEL0(K)
      LINE=LINE+(1)
      GOTO 10336
10334 LINE=LINE+(1)
10336 IF((LINE.GT.LINE20))GOTO 10335
        IF((.NOT.INTRPT(BRKFL0)))GOTO 10337
          RETURN
10337   IF((NEW(L-1).NE.138))GOTO 10338
          L=L-(1)
10338   K=NEXTL0(K)
        CALL GTXT(K)
        IF((L+SUBLEN-1+LINEL0(K)-1.LE.512))GOTO 10339
          ERRCO0=13
          RETURN
10339   CALL MOVE$(SUB,NEW(L),SUBLEN)
        L=L+(SUBLEN-1)
        CALL MOVE$(TXTAA0,NEW(L),LINEL0(K))
        L=L+(LINEL0(K)-1)
      GOTO 10334
10335 CURLN0=LINE20
      JOIN=INJECT(NEW)
      IF((JOIN.NE.-2))GOTO 10340
        JOIN=DELETE(LINE10,LINE20,JOIN)
10340 CURLN0=CURLN0+(1)
      IF((FIRSU0.LE.CURLN0))GOTO 10341
        FIRSU0=CURLN0
10341 RETURN
      END
      SUBROUTINE LITME0(LIT,TYPE)
      INTEGER LIT(1),TYPE
      INTEGER MSG(128)
      CALL PTOC(LIT,174,MSG,128)
      CALL MESG(MSG,TYPE)
      RETURN
      END
      INTEGER FUNCTION MOVE(LINE3)
      INTEGER LINE3
      COMMON /CLINES/LINE10,LINE20,NLINE0,CURLN0,LASTL0
      INTEGER LINE10,LINE20,NLINE0,CURLN0,LASTL0
      COMMON /CPAT/PATAA0(256),TLPAT0(256),SUBSA0(256),TSETA0(256)
      INTEGER PATAA0,TLPAT0,SUBSA0,TSETA0
      COMMON /CTXT/TXTAA0(512)
      INTEGER TXTAA0
      COMMON /CFILE/SAVFI0(512)
      INTEGER SAVFI0
      COMMON /CBUFR$/LASTB0,FENCE0,FREEA0,LINE00,BUFAA0(65520)
      INTEGER LASTB0,FENCE0,FREEA0,LINE00
      INTEGER BUFAA0
      INTEGER PREVL0(1),NEXTL0(1)
      INTEGER GLOBM0(1),LINEL0(1)
      INTEGER * 4 SEEKA0(1)
      INTEGER MARKN0(1)
      COMMON /CUNDO/LIMBO0,LIMCN0
      INTEGER LIMBO0,LIMCN0
      COMMON /CSCRAT/SCRAA0,SCREN0,SCRNA0(512),LOSTL0
      INTEGER SCRAA0
      INTEGER * 4 SCREN0
      INTEGER SCRNA0
      INTEGER LOSTL0
      COMMON /CMISC/BUFFE0,ERRCO0,SAVER0,PROBA0,ARGNO0,LASTC0,PEEKC0,SAV
     *CO0
      INTEGER BUFFE0,ERRCO0,SAVER0,PROBA0,ARGNO0,LASTC0
      INTEGER PEEKC0,SAVCO0(512)
      COMMON /CMARK/SAVKN0
      INTEGER SAVKN0
      COMMON /COPT/TABST0(512),TABSU0(512),UNPRI0,DDIRA0,ABSNO0,NCHOI0,O
     *VERM0,WARNC0,FIRST0,TSPEE0,INDEN0,GLOBA0
      INTEGER TABST0,TABSU0,UNPRI0
      INTEGER DDIRA0,ABSNO0,NCHOI0,OVERM0,WARNC0,FIRST0,TSPEE0,INDEN0,GL
     *OBA0
      COMMON /CTERM/TERMT0
      INTEGER TERMT0
      COMMON /CSCRN/SCREE0(128,51),MSGAL0(128),NROWS0,NCOLS0,CURRO0,CURC
     *O0,TOPRO0,BOTRO0,CMDRO0,TOPLN0,INSER0,INVER0,FIRSU0,RELAA0,RELZA0,
     *SCLEN0,SCTOP0,SCLIN0
      INTEGER SCREE0
      INTEGER MSGAL0,NROWS0,NCOLS0,CURRO0,CURCO0,TOPRO0,BOTRO0,CMDRO0,TO
     *PLN0,INSER0,INVER0,FIRSU0,RELAA0,RELZA0,SCLEN0,SCTOP0,SCLIN0(51)
      COMMON /CUNIX0/UNIXM0,BACKS0,NOTIN0,XMARK0,ESCAP0
      INTEGER UNIXM0
      INTEGER BACKS0,NOTIN0,XMARK0,ESCAP0
      COMMON /CTTY/TTYST0
      INTEGER TTYST0
      INTEGER PREVLN
      INTEGER K0,K1,K2,K3,K4,K5
      INTEGER GETIND
      EQUIVALENCE (PREVL0(1),BUFAA0(1)),(NEXTL0(1),BUFAA0(2)),(GLOBM0(1)
     *,BUFAA0(3)),(SEEKA0(1),BUFAA0(4)),(LINEL0(1),BUFAA0(6)),(MARKN0(1)
     *,BUFAA0(7))
      MOVE=-3
      IF((LINE10.GT.0))GOTO 10342
        ERRCO0=17
        GOTO 10343
10342   IF((LINE10.GT.LINE3))GOTO 10344
        IF((LINE3.GT.LINE20))GOTO 10344
          ERRCO0=10
          GOTO 10345
10344     K0=GETIND(PREVLN(LINE10))
          K1=NEXTL0(K0)
          K2=GETIND(LINE20)
          K3=NEXTL0(K2)
          CALL RELINK(K0,K3,K0,K3)
          IF((LINE3.LE.LINE10))GOTO 10346
            CURLN0=LINE3
            LINE3=LINE3-(LINE20-LINE10+1)
            GOTO 10347
10346       CURLN0=LINE3+(LINE20-LINE10+1)
10347     K4=GETIND(LINE3)
          K5=NEXTL0(K4)
          CALL RELINK(K4,K1,K2,K5)
          CALL RELINK(K2,K5,K4,K1)
          MOVE=-2
          BUFFE0=1
          FIRSU0=MIN0(FIRSU0,LINE10,LINE3)
10345 CONTINUE
10343 RETURN
      END
      INTEGER FUNCTION SETTAB(STR)
      INTEGER STR(1)
      COMMON /CLINES/LINE10,LINE20,NLINE0,CURLN0,LASTL0
      INTEGER LINE10,LINE20,NLINE0,CURLN0,LASTL0
      COMMON /CPAT/PATAA0(256),TLPAT0(256),SUBSA0(256),TSETA0(256)
      INTEGER PATAA0,TLPAT0,SUBSA0,TSETA0
      COMMON /CTXT/TXTAA0(512)
      INTEGER TXTAA0
      COMMON /CFILE/SAVFI0(512)
      INTEGER SAVFI0
      COMMON /CBUFR$/LASTB0,FENCE0,FREEA0,LINE00,BUFAA0(65520)
      INTEGER LASTB0,FENCE0,FREEA0,LINE00
      INTEGER BUFAA0
      INTEGER PREVL0(1),NEXTL0(1)
      INTEGER GLOBM0(1),LINEL0(1)
      INTEGER * 4 SEEKA0(1)
      INTEGER MARKN0(1)
      COMMON /CUNDO/LIMBO0,LIMCN0
      INTEGER LIMBO0,LIMCN0
      COMMON /CSCRAT/SCRAA0,SCREN0,SCRNA0(512),LOSTL0
      INTEGER SCRAA0
      INTEGER * 4 SCREN0
      INTEGER SCRNA0
      INTEGER LOSTL0
      COMMON /CMISC/BUFFE0,ERRCO0,SAVER0,PROBA0,ARGNO0,LASTC0,PEEKC0,SAV
     *CO0
      INTEGER BUFFE0,ERRCO0,SAVER0,PROBA0,ARGNO0,LASTC0
      INTEGER PEEKC0,SAVCO0(512)
      COMMON /CMARK/SAVKN0
      INTEGER SAVKN0
      COMMON /COPT/TABST0(512),TABSU0(512),UNPRI0,DDIRA0,ABSNO0,NCHOI0,O
     *VERM0,WARNC0,FIRST0,TSPEE0,INDEN0,GLOBA0
      INTEGER TABST0,TABSU0,UNPRI0
      INTEGER DDIRA0,ABSNO0,NCHOI0,OVERM0,WARNC0,FIRST0,TSPEE0,INDEN0,GL
     *OBA0
      COMMON /CTERM/TERMT0
      INTEGER TERMT0
      COMMON /CSCRN/SCREE0(128,51),MSGAL0(128),NROWS0,NCOLS0,CURRO0,CURC
     *O0,TOPRO0,BOTRO0,CMDRO0,TOPLN0,INSER0,INVER0,FIRSU0,RELAA0,RELZA0,
     *SCLEN0,SCTOP0,SCLIN0
      INTEGER SCREE0
      INTEGER MSGAL0,NROWS0,NCOLS0,CURRO0,CURCO0,TOPRO0,BOTRO0,CMDRO0,TO
     *PLN0,INSER0,INVER0,FIRSU0,RELAA0,RELZA0,SCLEN0,SCTOP0,SCLIN0(51)
      COMMON /CUNIX0/UNIXM0,BACKS0,NOTIN0,XMARK0,ESCAP0
      INTEGER UNIXM0
      INTEGER BACKS0,NOTIN0,XMARK0,ESCAP0
      COMMON /CTTY/TTYST0
      INTEGER TTYST0
      INTEGER I,J,N,MAXST0,LAST,INC
      INTEGER CTOI
      EQUIVALENCE (PREVL0(1),BUFAA0(1)),(NEXTL0(1),BUFAA0(2)),(GLOBM0(1)
     *,BUFAA0(3)),(SEEKA0(1),BUFAA0(4)),(LINEL0(1),BUFAA0(6)),(MARKN0(1)
     *,BUFAA0(7))
      I=1
      GOTO 10350
10348 I=I+(1)
10350 IF((I.GT.512))GOTO 10349
        TABST0(I)=0
      GOTO 10348
10349 SETTAB=-2
      MAXST0=0
      LAST=1
      I=1
10351 IF((STR(I).NE.160))GOTO 10352
        I=I+(1)
      GOTO 10351
10352 CONTINUE
10353 IF((STR(I).EQ.0))GOTO 10354
      IF((STR(I).EQ.138))GOTO 10354
        IF((STR(I).NE.171))GOTO 10355
          I=I+(1)
          INC=1
          GOTO 10356
10355     INC=0
10356   N=CTOI(STR,I)
        IF((N.LE.0))GOTO 10358
        IF((N.GE.512))GOTO 10358
        GOTO 10357
10358     SETTAB=-3
          ERRCO0=30
          GOTO 10354
10357   IF((STR(I).EQ.160))GOTO 10359
        IF((STR(I).EQ.171))GOTO 10359
        IF((STR(I).EQ.138))GOTO 10359
        IF((STR(I).EQ.0))GOTO 10359
          SETTAB=-3
          ERRCO0=9
          GOTO 10354
10359   IF((INC.NE.1))GOTO 10360
          J=LAST+N
          GOTO 10363
10361     J=J+(N)
10363     IF((J.GE.512))GOTO 10364
            TABST0(J)=1
            MAXST0=MAX0(J,MAXST0)
          GOTO 10361
10360     TABST0(N)=1
          LAST=N
          MAXST0=MAX0(N,MAXST0)
10364   CONTINUE
10365   IF((STR(I).NE.160))GOTO 10353
          I=I+(1)
        GOTO 10365
10354 IF((SETTAB.NE.-3))GOTO 10367
        MAXST0=0
10367 IF((MAXST0.NE.0))GOTO 10368
        I=4
        GOTO 10371
10369   I=I+(3)
10371   IF((I.GE.512))GOTO 10370
          TABST0(I)=1
        GOTO 10369
10370   MAXST0=I-3
10368 TABST0(1)=1
      I=MAXST0+1
      GOTO 10374
10372 I=I+(1)
10374 IF((I.GT.512))GOTO 10373
        TABST0(I)=1
      GOTO 10372
10373 RETURN
      END
      SUBROUTINE UNIQU0(KNAME,STATUS)
      INTEGER KNAME
      INTEGER STATUS
      COMMON /CLINES/LINE10,LINE20,NLINE0,CURLN0,LASTL0
      INTEGER LINE10,LINE20,NLINE0,CURLN0,LASTL0
      COMMON /CPAT/PATAA0(256),TLPAT0(256),SUBSA0(256),TSETA0(256)
      INTEGER PATAA0,TLPAT0,SUBSA0,TSETA0
      COMMON /CTXT/TXTAA0(512)
      INTEGER TXTAA0
      COMMON /CFILE/SAVFI0(512)
      INTEGER SAVFI0
      COMMON /CBUFR$/LASTB0,FENCE0,FREEA0,LINE00,BUFAA0(65520)
      INTEGER LASTB0,FENCE0,FREEA0,LINE00
      INTEGER BUFAA0
      INTEGER PREVL0(1),NEXTL0(1)
      INTEGER GLOBM0(1),LINEL0(1)
      INTEGER * 4 SEEKA0(1)
      INTEGER MARKN0(1)
      COMMON /CUNDO/LIMBO0,LIMCN0
      INTEGER LIMBO0,LIMCN0
      COMMON /CSCRAT/SCRAA0,SCREN0,SCRNA0(512),LOSTL0
      INTEGER SCRAA0
      INTEGER * 4 SCREN0
      INTEGER SCRNA0
      INTEGER LOSTL0
      COMMON /CMISC/BUFFE0,ERRCO0,SAVER0,PROBA0,ARGNO0,LASTC0,PEEKC0,SAV
     *CO0
      INTEGER BUFFE0,ERRCO0,SAVER0,PROBA0,ARGNO0,LASTC0
      INTEGER PEEKC0,SAVCO0(512)
      COMMON /CMARK/SAVKN0
      INTEGER SAVKN0
      COMMON /COPT/TABST0(512),TABSU0(512),UNPRI0,DDIRA0,ABSNO0,NCHOI0,O
     *VERM0,WARNC0,FIRST0,TSPEE0,INDEN0,GLOBA0
      INTEGER TABST0,TABSU0,UNPRI0
      INTEGER DDIRA0,ABSNO0,NCHOI0,OVERM0,WARNC0,FIRST0,TSPEE0,INDEN0,GL
     *OBA0
      COMMON /CTERM/TERMT0
      INTEGER TERMT0
      COMMON /CSCRN/SCREE0(128,51),MSGAL0(128),NROWS0,NCOLS0,CURRO0,CURC
     *O0,TOPRO0,BOTRO0,CMDRO0,TOPLN0,INSER0,INVER0,FIRSU0,RELAA0,RELZA0,
     *SCLEN0,SCTOP0,SCLIN0
      INTEGER SCREE0
      INTEGER MSGAL0,NROWS0,NCOLS0,CURRO0,CURCO0,TOPRO0,BOTRO0,CMDRO0,TO
     *PLN0,INSER0,INVER0,FIRSU0,RELAA0,RELZA0,SCLEN0,SCTOP0,SCLIN0(51)
      COMMON /CUNIX0/UNIXM0,BACKS0,NOTIN0,XMARK0,ESCAP0
      INTEGER UNIXM0
      INTEGER BACKS0,NOTIN0,XMARK0,ESCAP0
      COMMON /CTTY/TTYST0
      INTEGER TTYST0
      INTEGER K,LINE
      EQUIVALENCE (PREVL0(1),BUFAA0(1)),(NEXTL0(1),BUFAA0(2)),(GLOBM0(1)
     *,BUFAA0(3)),(SEEKA0(1),BUFAA0(4)),(LINEL0(1),BUFAA0(6)),(MARKN0(1)
     *,BUFAA0(7))
      CALL DEFALT(CURLN0,CURLN0)
      IF((LINE10.GT.0))GOTO 10375
        STATUS=-3
        ERRCO0=17
        RETURN
10375 STATUS=-2
      LINE=0
      K=LINE00
10376   LINE=LINE+(1)
        K=NEXTL0(K)
        IF((LINE.NE.LINE20))GOTO 10377
          MARKN0(K)=KNAME
          GOTO 10378
10377     IF((MARKN0(K).NE.KNAME))GOTO 10379
            MARKN0(K)=160
10379   CONTINUE
10378 CONTINUE
      IF((LINE.LT.LASTL0))GOTO 10376
      RETURN
      END
      INTEGER FUNCTION GETKN(LIN,I,KNAME,DFLTNM)
      INTEGER LIN(1),KNAME
      INTEGER I,DFLTNM
      IF((LIN(I).EQ.138))GOTO 10381
      IF((LIN(I).EQ.0))GOTO 10381
      GOTO 10380
10381   KNAME=DFLTNM
        GETKN=-1
        GOTO 10382
10380   KNAME=LIN(I)
        I=I+(1)
        GETKN=-2
10382 RETURN
      END
      SUBROUTINE PRINT0
      COMMON /CLINES/LINE10,LINE20,NLINE0,CURLN0,LASTL0
      INTEGER LINE10,LINE20,NLINE0,CURLN0,LASTL0
      COMMON /CPAT/PATAA0(256),TLPAT0(256),SUBSA0(256),TSETA0(256)
      INTEGER PATAA0,TLPAT0,SUBSA0,TSETA0
      COMMON /CTXT/TXTAA0(512)
      INTEGER TXTAA0
      COMMON /CFILE/SAVFI0(512)
      INTEGER SAVFI0
      COMMON /CBUFR$/LASTB0,FENCE0,FREEA0,LINE00,BUFAA0(65520)
      INTEGER LASTB0,FENCE0,FREEA0,LINE00
      INTEGER BUFAA0
      INTEGER PREVL0(1),NEXTL0(1)
      INTEGER GLOBM0(1),LINEL0(1)
      INTEGER * 4 SEEKA0(1)
      INTEGER MARKN0(1)
      COMMON /CUNDO/LIMBO0,LIMCN0
      INTEGER LIMBO0,LIMCN0
      COMMON /CSCRAT/SCRAA0,SCREN0,SCRNA0(512),LOSTL0
      INTEGER SCRAA0
      INTEGER * 4 SCREN0
      INTEGER SCRNA0
      INTEGER LOSTL0
      COMMON /CMISC/BUFFE0,ERRCO0,SAVER0,PROBA0,ARGNO0,LASTC0,PEEKC0,SAV
     *CO0
      INTEGER BUFFE0,ERRCO0,SAVER0,PROBA0,ARGNO0,LASTC0
      INTEGER PEEKC0,SAVCO0(512)
      COMMON /CMARK/SAVKN0
      INTEGER SAVKN0
      COMMON /COPT/TABST0(512),TABSU0(512),UNPRI0,DDIRA0,ABSNO0,NCHOI0,O
     *VERM0,WARNC0,FIRST0,TSPEE0,INDEN0,GLOBA0
      INTEGER TABST0,TABSU0,UNPRI0
      INTEGER DDIRA0,ABSNO0,NCHOI0,OVERM0,WARNC0,FIRST0,TSPEE0,INDEN0,GL
     *OBA0
      COMMON /CTERM/TERMT0
      INTEGER TERMT0
      COMMON /CSCRN/SCREE0(128,51),MSGAL0(128),NROWS0,NCOLS0,CURRO0,CURC
     *O0,TOPRO0,BOTRO0,CMDRO0,TOPLN0,INSER0,INVER0,FIRSU0,RELAA0,RELZA0,
     *SCLEN0,SCTOP0,SCLIN0
      INTEGER SCREE0
      INTEGER MSGAL0,NROWS0,NCOLS0,CURRO0,CURCO0,TOPRO0,BOTRO0,CMDRO0,TO
     *PLN0,INSER0,INVER0,FIRSU0,RELAA0,RELZA0,SCLEN0,SCTOP0,SCLIN0(51)
      COMMON /CUNIX0/UNIXM0,BACKS0,NOTIN0,XMARK0,ESCAP0
      INTEGER UNIXM0
      INTEGER BACKS0,NOTIN0,XMARK0,ESCAP0
      COMMON /CTTY/TTYST0
      INTEGER TTYST0
      INTEGER AAAAS0
      EQUIVALENCE (PREVL0(1),BUFAA0(1)),(NEXTL0(1),BUFAA0(2)),(GLOBM0(1)
     *,BUFAA0(3)),(SEEKA0(1),BUFAA0(4)),(LINEL0(1),BUFAA0(6)),(MARKN0(1)
     *,BUFAA0(7))
      AAAAS0=ERRCO0
      GOTO 10383
10384   CALL REMARK('Line numbers in backward order.')
      GOTO 10385
10386   CALL REMARK('No room for any more lines!.')
      GOTO 10385
10387   CALL REMARK('Bad syntax in pattern.')
      GOTO 10385
10388   CALL REMARK('Bad syntax in string parameter.')
      GOTO 10385
10389   CALL REMARK('Bad syntax in substitution string.')
      GOTO 10385
10390   CALL REMARK('File is not readable.')
      GOTO 10385
10391   CALL REMARK('File is not writeable.')
      GOTO 10385
10392   CALL REMARK('Garbage after your command.')
      GOTO 10385
10393   CALL REMARK('Bad syntax in file name.')
      GOTO 10385
10394   CALL REMARK('Can''t move a group into itself.')
      GOTO 10385
10395   CALL REMARK('No line has that mark name.')
      GOTO 10385
10396   CALL REMARK('Resultant line too long to handle.')
      GOTO 10385
10397   CALL REMARK('No match for pattern.')
      GOTO 10385
10398   CALL REMARK('No error to report.')
      GOTO 10385
10399   CALL REMARK('No lines in limbo.')
      GOTO 10385
10400   CALL REMARK('Expected "<", ">", or nothing after "od".')
      GOTO 10385
10401   CALL REMARK('Line number out of range.')
      GOTO 10385
10402   CALL REMARK('Can''t recognize option.')
      GOTO 10385
10403   CALL REMARK('No line contains that pattern.')
      GOTO 10385
10404   CALL REMARK('Buffer hasn''t been saved.')
      GOTO 10385
10405   CALL REMARK('No command recognized.')
      GOTO 10385
10406   CALL REMARK('Last line number beyond end of file.')
      GOTO 10385
10407   CALL REMARK('You interrupted me.')
      GOTO 10385
10408   CALL REMARK('No saved pattern -- sorry.')
      GOTO 10385
10409   CALL REMARK('No saved character list -- sorry.')
      GOTO 10385
10410   CALL REMARK('No saved filename.')
      GOTO 10385
10411   CALL REMARK('Bad syntax in character list.')
      GOTO 10385
10412   CALL REMARK('Unreasonable value.')
      GOTO 10385
10413   CALL REMARK('No help available.')
      GOTO 10385
10414   CALL REMARK('Line numbers not allowed.')
      GOTO 10385
10415   CALL REMARK('Bad tabstop syntax.')
      GOTO 10385
10416   CALL REMARK('File already exists.')
      GOTO 10385
10417   CALL REMARK('Improper column number specification.')
      GOTO 10385
10418   CALL REMARK('Unknown source language.')
      GOTO 10385
10419   CALL REMARK('No saved replacement -- sorry.')
      GOTO 10385
10420   CALL REMARK('Bad user identifier.')
      GOTO 10385
10421   CALL REMARK('User is busy -- try again later.')
      GOTO 10385
10422   CALL REMARK('Shell returned ERR.')
      GOTO 10385
10423   CALL REMARK('No saved shell command -- sorry.')
      GOTO 10385
10383 GOTO(10384,10408,10387,10388,10389,10390,10392,10393,10415,10394, 
     *    10395,10424,10396,10398,10399,10400,10401,10402,10403,10404,  
     *   10405,10407,10406,10391,10386,10397,10410,10411,10409,10412,   
     *  10413,10414,10416,10417,10418,10419,10420,10421,10422,10423),AAA
     *AS0
10424   CALL REMARK('?.')
10385 ERRCO0=14
      RETURN
      END
      SUBROUTINE SAYNUM(N)
      INTEGER N
      INTEGER ITOC
      INTEGER S(10)
      CALL ITOC(N,S,10)
      CALL MESG(S,1)
      RETURN
      END
      INTEGER FUNCTION KNSCAN(WAY,NUM)
      INTEGER WAY,NUM
      COMMON /CLINES/LINE10,LINE20,NLINE0,CURLN0,LASTL0
      INTEGER LINE10,LINE20,NLINE0,CURLN0,LASTL0
      COMMON /CPAT/PATAA0(256),TLPAT0(256),SUBSA0(256),TSETA0(256)
      INTEGER PATAA0,TLPAT0,SUBSA0,TSETA0
      COMMON /CTXT/TXTAA0(512)
      INTEGER TXTAA0
      COMMON /CFILE/SAVFI0(512)
      INTEGER SAVFI0
      COMMON /CBUFR$/LASTB0,FENCE0,FREEA0,LINE00,BUFAA0(65520)
      INTEGER LASTB0,FENCE0,FREEA0,LINE00
      INTEGER BUFAA0
      INTEGER PREVL0(1),NEXTL0(1)
      INTEGER GLOBM0(1),LINEL0(1)
      INTEGER * 4 SEEKA0(1)
      INTEGER MARKN0(1)
      COMMON /CUNDO/LIMBO0,LIMCN0
      INTEGER LIMBO0,LIMCN0
      COMMON /CSCRAT/SCRAA0,SCREN0,SCRNA0(512),LOSTL0
      INTEGER SCRAA0
      INTEGER * 4 SCREN0
      INTEGER SCRNA0
      INTEGER LOSTL0
      COMMON /CMISC/BUFFE0,ERRCO0,SAVER0,PROBA0,ARGNO0,LASTC0,PEEKC0,SAV
     *CO0
      INTEGER BUFFE0,ERRCO0,SAVER0,PROBA0,ARGNO0,LASTC0
      INTEGER PEEKC0,SAVCO0(512)
      COMMON /CMARK/SAVKN0
      INTEGER SAVKN0
      COMMON /COPT/TABST0(512),TABSU0(512),UNPRI0,DDIRA0,ABSNO0,NCHOI0,O
     *VERM0,WARNC0,FIRST0,TSPEE0,INDEN0,GLOBA0
      INTEGER TABST0,TABSU0,UNPRI0
      INTEGER DDIRA0,ABSNO0,NCHOI0,OVERM0,WARNC0,FIRST0,TSPEE0,INDEN0,GL
     *OBA0
      COMMON /CTERM/TERMT0
      INTEGER TERMT0
      COMMON /CSCRN/SCREE0(128,51),MSGAL0(128),NROWS0,NCOLS0,CURRO0,CURC
     *O0,TOPRO0,BOTRO0,CMDRO0,TOPLN0,INSER0,INVER0,FIRSU0,RELAA0,RELZA0,
     *SCLEN0,SCTOP0,SCLIN0
      INTEGER SCREE0
      INTEGER MSGAL0,NROWS0,NCOLS0,CURRO0,CURCO0,TOPRO0,BOTRO0,CMDRO0,TO
     *PLN0,INSER0,INVER0,FIRSU0,RELAA0,RELZA0,SCLEN0,SCTOP0,SCLIN0(51)
      COMMON /CUNIX0/UNIXM0,BACKS0,NOTIN0,XMARK0,ESCAP0
      INTEGER UNIXM0
      INTEGER BACKS0,NOTIN0,XMARK0,ESCAP0
      COMMON /CTTY/TTYST0
      INTEGER TTYST0
      INTEGER K
      INTEGER GETIND
      LOGICAL INTRPT,BRKFL0
      EQUIVALENCE (PREVL0(1),BUFAA0(1)),(NEXTL0(1),BUFAA0(2)),(GLOBM0(1)
     *,BUFAA0(3)),(SEEKA0(1),BUFAA0(4)),(LINEL0(1),BUFAA0(6)),(MARKN0(1)
     *,BUFAA0(7))
      NUM=CURLN0
      K=GETIND(NUM)
10425   CALL BUMP(NUM,K,WAY)
        IF((MARKN0(K).NE.SAVKN0))GOTO 10426
          KNSCAN=-2
          RETURN
10426 CONTINUE
      IF((NUM.EQ.CURLN0))GOTO 10427
      IF(INTRPT(BRKFL0))GOTO 10427
      GOTO 10425
10427 CONTINUE
      KNSCAN=-3
      IF((ERRCO0.NE.7))GOTO 10428
        ERRCO0=11
10428 RETURN
      END
      INTEGER FUNCTION DOGLOB(LIN,I,CURSAV,STATUS)
      INTEGER LIN(512)
      INTEGER I,CURSAV,STATUS
      COMMON /CLINES/LINE10,LINE20,NLINE0,CURLN0,LASTL0
      INTEGER LINE10,LINE20,NLINE0,CURLN0,LASTL0
      COMMON /CPAT/PATAA0(256),TLPAT0(256),SUBSA0(256),TSETA0(256)
      INTEGER PATAA0,TLPAT0,SUBSA0,TSETA0
      COMMON /CTXT/TXTAA0(512)
      INTEGER TXTAA0
      COMMON /CFILE/SAVFI0(512)
      INTEGER SAVFI0
      COMMON /CBUFR$/LASTB0,FENCE0,FREEA0,LINE00,BUFAA0(65520)
      INTEGER LASTB0,FENCE0,FREEA0,LINE00
      INTEGER BUFAA0
      INTEGER PREVL0(1),NEXTL0(1)
      INTEGER GLOBM0(1),LINEL0(1)
      INTEGER * 4 SEEKA0(1)
      INTEGER MARKN0(1)
      COMMON /CUNDO/LIMBO0,LIMCN0
      INTEGER LIMBO0,LIMCN0
      COMMON /CSCRAT/SCRAA0,SCREN0,SCRNA0(512),LOSTL0
      INTEGER SCRAA0
      INTEGER * 4 SCREN0
      INTEGER SCRNA0
      INTEGER LOSTL0
      COMMON /CMISC/BUFFE0,ERRCO0,SAVER0,PROBA0,ARGNO0,LASTC0,PEEKC0,SAV
     *CO0
      INTEGER BUFFE0,ERRCO0,SAVER0,PROBA0,ARGNO0,LASTC0
      INTEGER PEEKC0,SAVCO0(512)
      COMMON /CMARK/SAVKN0
      INTEGER SAVKN0
      COMMON /COPT/TABST0(512),TABSU0(512),UNPRI0,DDIRA0,ABSNO0,NCHOI0,O
     *VERM0,WARNC0,FIRST0,TSPEE0,INDEN0,GLOBA0
      INTEGER TABST0,TABSU0,UNPRI0
      INTEGER DDIRA0,ABSNO0,NCHOI0,OVERM0,WARNC0,FIRST0,TSPEE0,INDEN0,GL
     *OBA0
      COMMON /CTERM/TERMT0
      INTEGER TERMT0
      COMMON /CSCRN/SCREE0(128,51),MSGAL0(128),NROWS0,NCOLS0,CURRO0,CURC
     *O0,TOPRO0,BOTRO0,CMDRO0,TOPLN0,INSER0,INVER0,FIRSU0,RELAA0,RELZA0,
     *SCLEN0,SCTOP0,SCLIN0
      INTEGER SCREE0
      INTEGER MSGAL0,NROWS0,NCOLS0,CURRO0,CURCO0,TOPRO0,BOTRO0,CMDRO0,TO
     *PLN0,INSER0,INVER0,FIRSU0,RELAA0,RELZA0,SCLEN0,SCTOP0,SCLIN0(51)
      COMMON /CUNIX0/UNIXM0,BACKS0,NOTIN0,XMARK0,ESCAP0
      INTEGER UNIXM0
      INTEGER BACKS0,NOTIN0,XMARK0,ESCAP0
      COMMON /CTTY/TTYST0
      INTEGER TTYST0
      INTEGER ISTART,LINE
      INTEGER DOCMD,GETLST
      INTEGER K
      LOGICAL INTRPT,BRKFL0
      EQUIVALENCE (PREVL0(1),BUFAA0(1)),(NEXTL0(1),BUFAA0(2)),(GLOBM0(1)
     *,BUFAA0(3)),(SEEKA0(1),BUFAA0(4)),(LINEL0(1),BUFAA0(6)),(MARKN0(1)
     *,BUFAA0(7))
      STATUS=-2
      ISTART=I
      K=LINE00
      LINE=0
10429   LINE=LINE+(1)
        K=NEXTL0(K)
        IF((GLOBM0(K).NE.1))GOTO 10430
          GLOBM0(K)=0
          CURLN0=LINE
          CURSAV=CURLN0
          I=ISTART
          IF((GETLST(LIN,I,STATUS).NE.-2))GOTO 10431
            CALL DOCMD(LIN,I,1,STATUS)
10431     LINE=0
          K=LINE00
10430   IF((.NOT.INTRPT(BRKFL0)))GOTO 10432
          STATUS=-3
10432 CONTINUE
      IF((LINE.GT.LASTL0))GOTO 10433
      IF((STATUS.NE.-2))GOTO 10433
      GOTO 10429
10433 CONTINUE
      DOGLOB=STATUS
      RETURN
      END
      INTEGER FUNCTION DOSHE0(LIN,INI)
      INTEGER LIN(1)
      INTEGER INI
      COMMON /CLINES/LINE10,LINE20,NLINE0,CURLN0,LASTL0
      INTEGER LINE10,LINE20,NLINE0,CURLN0,LASTL0
      COMMON /CPAT/PATAA0(256),TLPAT0(256),SUBSA0(256),TSETA0(256)
      INTEGER PATAA0,TLPAT0,SUBSA0,TSETA0
      COMMON /CTXT/TXTAA0(512)
      INTEGER TXTAA0
      COMMON /CFILE/SAVFI0(512)
      INTEGER SAVFI0
      COMMON /CBUFR$/LASTB0,FENCE0,FREEA0,LINE00,BUFAA0(65520)
      INTEGER LASTB0,FENCE0,FREEA0,LINE00
      INTEGER BUFAA0
      INTEGER PREVL0(1),NEXTL0(1)
      INTEGER GLOBM0(1),LINEL0(1)
      INTEGER * 4 SEEKA0(1)
      INTEGER MARKN0(1)
      COMMON /CUNDO/LIMBO0,LIMCN0
      INTEGER LIMBO0,LIMCN0
      COMMON /CSCRAT/SCRAA0,SCREN0,SCRNA0(512),LOSTL0
      INTEGER SCRAA0
      INTEGER * 4 SCREN0
      INTEGER SCRNA0
      INTEGER LOSTL0
      COMMON /CMISC/BUFFE0,ERRCO0,SAVER0,PROBA0,ARGNO0,LASTC0,PEEKC0,SAV
     *CO0
      INTEGER BUFFE0,ERRCO0,SAVER0,PROBA0,ARGNO0,LASTC0
      INTEGER PEEKC0,SAVCO0(512)
      COMMON /CMARK/SAVKN0
      INTEGER SAVKN0
      COMMON /COPT/TABST0(512),TABSU0(512),UNPRI0,DDIRA0,ABSNO0,NCHOI0,O
     *VERM0,WARNC0,FIRST0,TSPEE0,INDEN0,GLOBA0
      INTEGER TABST0,TABSU0,UNPRI0
      INTEGER DDIRA0,ABSNO0,NCHOI0,OVERM0,WARNC0,FIRST0,TSPEE0,INDEN0,GL
     *OBA0
      COMMON /CTERM/TERMT0
      INTEGER TERMT0
      COMMON /CSCRN/SCREE0(128,51),MSGAL0(128),NROWS0,NCOLS0,CURRO0,CURC
     *O0,TOPRO0,BOTRO0,CMDRO0,TOPLN0,INSER0,INVER0,FIRSU0,RELAA0,RELZA0,
     *SCLEN0,SCTOP0,SCLIN0
      INTEGER SCREE0
      INTEGER MSGAL0,NROWS0,NCOLS0,CURRO0,CURCO0,TOPRO0,BOTRO0,CMDRO0,TO
     *PLN0,INSER0,INVER0,FIRSU0,RELAA0,RELZA0,SCLEN0,SCTOP0,SCLIN0(51)
      COMMON /CUNIX0/UNIXM0,BACKS0,NOTIN0,XMARK0,ESCAP0
      INTEGER UNIXM0
      INTEGER BACKS0,NOTIN0,XMARK0,ESCAP0
      COMMON /CTTY/TTYST0
      INTEGER TTYST0
      INTEGER C
      INTEGER I,J,K
      INTEGER AUTOR0,EXPAN0
      INTEGER NEWCO0(512)
      INTEGER RETUR0,SHELL,SUBSYS
      INTEGER AAAAT0(5)
      INTEGER AAAAU0(5)
      INTEGER AAAAV0(26)
      EQUIVALENCE (PREVL0(1),BUFAA0(1)),(NEXTL0(1),BUFAA0(2)),(GLOBM0(1)
     *,BUFAA0(3)),(SEEKA0(1),BUFAA0(4)),(LINEL0(1),BUFAA0(6)),(MARKN0(1)
     *,BUFAA0(7))
      DATA AAAAT0/170,238,170,238,0/
      DATA AAAAU0/170,243,170,238,0/
      DATA AAAAV0/244,249,240,229,160,242,229,244,245,242,238,160,244,23
     *9,160,227,239,238,244,233,238,245,229,186,160,0/
      EXPAN0=0
      IF((NLINE0.NE.0))GOTO 10434
        CALL POSIT0(NROWS0,1)
        IF((LIN(INI).NE.138))GOTO 10435
          AUTOR0=1
          GOTO 10436
10435     AUTOR0=0
10436   IF((LIN(INI).NE.161))GOTO 10437
          IF((SAVCO0(1).EQ.0))GOTO 10438
            J=1
            GOTO 10441
10439       J=J+(1)
10441       IF((SAVCO0(J).EQ.0))GOTO 10440
              NEWCO0(J)=SAVCO0(J)
            GOTO 10439
10440       IF((NEWCO0(J-1).NE.138))GOTO 10442
              J=J-(1)
10442       INI=INI+(1)
            EXPAN0=1
            GOTO 10444
10438       ERRCO0=40
            DOSHE0=-3
            RETURN
10437     J=1
10444   I=INI
        GOTO 10447
10445   I=I+(1)
10447   IF((LIN(I).EQ.0))GOTO 10446
          IF((LIN(I).NE.ESCAP0))GOTO 10448
            IF((LIN(I+1).EQ.165))GOTO 10449
              NEWCO0(J)=ESCAP0
              NEWCO0(J+1)=LIN(I+1)
              J=J+(2)
              I=I+(1)
              GOTO 10445
10449         I=I+(1)
              NEWCO0(J)=LIN(I)
              J=J+(1)
10450       GOTO 10445
10448       IF((LIN(I).NE.165))GOTO 10452
              K=1
              GOTO 10455
10453         K=K+(1)
10455         IF((SAVFI0(K).EQ.0))GOTO 10454
                NEWCO0(J)=SAVFI0(K)
                J=J+(1)
              GOTO 10453
10454         EXPAN0=1
              GOTO 10456
10452         NEWCO0(J)=LIN(I)
              J=J+(1)
10456     CONTINUE
10451   GOTO 10445
10446   IF((NEWCO0(J-1).NE.138))GOTO 10457
          J=J-(1)
10457   NEWCO0(J)=0
        CALL SCOPY(NEWCO0,1,SAVCO0,1)
        CALL DUPLX$(TTYST0)
        CALL BREAK$(0)
        CALL PRINT(-11,AAAAT0)
        IF((AUTOR0.NE.1))GOTO 10458
          RETUR0=SHELL(-10)
          GOTO 10459
10458     IF((EXPAN0.NE.1))GOTO 10460
            CALL PRINT(-11,AAAAU0,NEWCO0)
10460     RETUR0=SUBSYS(NEWCO0)
10459   IF((AUTOR0.NE.0))GOTO 10461
        IF((RETUR0.NE.-2))GOTO 10461
          CALL PRINT(-11,AAAAV0)
10462       CALL T1IN(C)
          IF((C.EQ.138))GOTO 10463
          IF((C.EQ.-1))GOTO 10463
          GOTO 10462
10463     CONTINUE
10461   CALL DUPLX$(:140000)
        CALL BREAK$(1)
        CALL RESTO0
        IF((RETUR0.NE.-3))GOTO 10464
          ERRCO0=39
          DOSHE0=-3
          RETURN
10464     DOSHE0=-2
          RETURN
10434   CALL REMARK('Not implemented.')
      IF((RETUR0.EQ.-2))GOTO 10465
        ERRCO0=39
        DOSHE0=-3
        RETURN
10465   DOSHE0=-2
        RETURN
      END
      SUBROUTINE WHERE0
      INTEGER FD,OPEN,GETLIN,LENGTH
      INTEGER I
      INTEGER BUF(512)
      INTEGER UNKNO0(8)
      INTEGER AAAAW0(15)
      DATA UNKNO0/245,238,235,238,239,247,238,0/
      DATA AAAAW0/189,233,238,243,244,225,236,236,225,244,233,239,238,18
     *9,0/
      FD=OPEN(AAAAW0,1)
      IF((FD.NE.-3))GOTO 10466
        CALL SCOPY(UNKNO0,1,BUF,1)
        GOTO 10467
10466   I=GETLIN(BUF,FD,512)
        IF((I.EQ.-3))GOTO 10469
        IF((I.EQ.-1))GOTO 10469
        GOTO 10468
10469     CALL SCOPY(UNKNO0,1,BUF,1)
10468   CALL CLOSE(FD)
10467 I=LENGTH(BUF)
      IF((BUF(I).NE.138))GOTO 10470
        BUF(I)=0
10470 CALL MESG(BUF,1)
      RETURN
      END
C ---- Long Name Map ----
C Toprow                         topro0
C Sctop                          sctop0
C inslines                       insli0
C autoredraw                     autor0
C Lostlines                      lostl0
C Indent                         inden0
C Invertcase                     inver0
C tempstr                        temps0
C Fence                          fence0
C unknown                        unkno0
C Topln                          topln0
C gt40pos                        gt40p0
C terakpos                       terak0
C Savfil                         savfi0
C Line0                          line00
C Tspeed                         tspee0
C clrscreen                      clrsc0
C printverboseerrormessage       print0
C Line1                          line10
C Absnos                         absno0
C uniquelyname                   uniqu0
C Line2                          line20
C Limcnt                         limcn0
C Curcol                         curco0
C Insertmode                     inser0
C filename                       filen0
C dologout                       dolog0
C doshell                        doshe0
C Nlines                         nline0
C Savcom                         savco0
C unixhelp                       unixh0
C Peekc                          peekc0
C addspos                        addsp0
C fixscreen                      fixsc0
C Prevline                       prevl0
C Cmdrow                         cmdro0
C adjustwindow                   adjus0
C Bufferchanged                  buffe0
C Errcode                        errco0
C Firstcol                       first0
C Globals                        globa0
C updscreen                      updsc0
C Lastln                         lastl0
C Nextline                       nextl0
C Overlaycol                     overm0
C Txt                            txtaa0
C Savknm                         savkn0
C Tabstr                         tabsu0
C Nrows                          nrows0
C Unixmode                       unixm0
C expanded                       expan0
C setscreen                      setsc0
C forsyspos                      forsy0
C Scrname                        scrna0
C Nchoise                        nchoi0
C litmesg                        litme0
C getrange                       getra0
C drawbox                        drawb0
C Seekaddr                       seeka0
C Limbo                          limbo0
C garbagecollect                 garba0
C Subs                           subsa0
C Relz                           relza0
C dellines                       delli0
C displaymessage                 displ0
C loadstr                        loads0
C restorescreen                  resto0
C Tabstops                       tabst0
C Sclen                          sclen0
C newcommand                     newco0
C cleartoeol                     clear0
C Buf                            bufaa0
C whereami                       where0
C Tset                           tseta0
C Argno                          argno0
C ansipos                        ansip0
C Unprintable                    unpri0
C regentpos                      regen0
C endoffile                      endof0
C lastsub                        lasts0
C sendmesg                       sendm0
C Botrow                         botro0
C Markname                       markn0
C Probation                      proba0
C Lastcharscanned                lastc0
C Warncol                        warnc0
C initialize                     initi0
C overlay                        overl0
C Pat                            pataa0
C Lineleng                       linel0
C cunixswt                       cunix0
C decodemnemonic                 decod0
C Globmark                       globm0
C Termtype                       termt0
C Ncols                          ncols0
C Currow                         curro0
C brkflag                        brkfl0
C recvmesg                       recvm0
C Scr                            scraa0
C Firstaffected                  firsu0
C NOTINCCL                       notin0
C bee2pos                        bee2p0
C positioncursor                 posit0
C Msgalloc                       msgal0
C savedsub                       saved0
C hwinsdel                       hwins0
C litnnum                        litnn0
C Screenimage                    scree0
C gettermtype                    gette0
C sbeecoord                      sbeec0
C warndeleted                    warnd0
C Curln                          curln0
C Free                           freea0
C XMARK                          xmark0
C b200coord                      b200c0
C spinject                       spinj0
C Tlpat                          tlpat0
C Lastbf                         lastb0
C Saverrcode                     saver0
C Ddir                           ddira0
C Rela                           relaa0
C ESCAPE                         escap0
C senddelay                      sendd0
C Scline                         sclin0
C Ttystate                       ttyst0
C returncode                     retur0
C cgcoord                        cgcoo0
C Scrend                         scren0
C BACKSCAN                       backs0
C maxstop                        maxst0
