1001 PRINT "Beginning pass ";PASS;" ";TIME$:FILENO=2:OPEN INFILE$ FOR INPUT AS #FILENO:IF PASS=1 THEN OPEN LSTFILE$ FOR OUTPUT AS #1 ELSE OPEN OUTFILE$ FOR OUTPUT AS #1
1002 LNBR=1000:LINC=1:OU$=""
1003 GOSUB 1009:IF STMT$="" THEN 1008
1004 IF (LEN(OU$)+LEN(STMT$)>200) OR FORCENEW THEN GOSUB 1046:OU$=""
1005 IF OU$<>"" THEN OU$=OU$+":"
1006 OU$=OU$+STMT$:IF FOUNDIF THEN FORCENEW=TRUE:FOUNDIF=FALSE
1007 GOTO 1003
1008 GOSUB 1046:CLOSE #1:CLOSE #FILENO:NEXT PASS:BEEP:PRINT "End of run ";TIME$:BEEP:END
1009 STMT$="":NEWLAB=FALSE
1010 IF EOF(FILENO) THEN 1026
1011 LINE INPUT #FILENO,IN$:IF PASS=1 THEN PRINT #1,IN$
1012 INMAX=LEN(IN$):IF INMAX<1 THEN 1010
1013 W$=LEFT$(IN$,1):INIX=1:IF W$="*" THEN 1010
1014 IF W$="@" THEN GOSUB 1028
1015 GOSUB 1035:IF WORD$="COPY" THEN 1024 ELSE 1017
1016 GOSUB 1035
1017 IF LEFT$(WORD$,1)="@" THEN GOSUB 1030
1018 IF STMT$<>"" AND WORD$<>"" AND RIGHT$(STMT$,1)<>":" AND WORD$<>":" THEN STMT$=STMT$+" "
1019 STMT$=STMT$+WORD$:IF WORD$="IF" THEN FOUNDIF=TRUE
1020 IF WORD$<>"" THEN 1016
1021 IF INIX<=INMAX THEN IF W$="~" THEN 1010
1022 IF STMT$="" THEN 1010
1023 RETURN
1024 GOSUB 1035:FILENO=FILENO+1:ON ERROR GOTO 1025:OPEN WORD$ FOR INPUT AS #FILENO:ON ERROR GOTO 0:PRINT "Now copying ";WORD$:GOTO 1010
1025 ON ERROR GOTO 0:BEEP:PRINT "File ";INFILE$;" not found; ignored":FILENO=FILENO-1:GOTO 1010
1026 IF FILENO=2 THEN 1023
1027 CLOSE #FILENO:FILENO=FILENO-1:GOTO 1010
1028 FORCENEW=TRUE:GOSUB 1035:IF PASS=2 THEN RETURN