	REM 10/25/78
	DIM LINE$(150),ANS$(1),FILE$(50)
	DIM IN/1/,OUT/2/
10	PRINT "STRIP V1.0 -- STRIPS CONDITIONAL 'IF'S FROM ASSEMBLY SOURCE"
	PRINT "READS ASSEMBLY SOURCE, PRODUCES COPY OF SOURCE FILE"
	PRINT "WHEN 'IF' ENCOUNTERED, USER RESPONSE IS INTERPRETED AS:"
	PRINT "<CR>  COPIES 'IF'/'ELSE'/'FIN' IN UNCHANGED FORM"
	PRINT "D     DROP 'IF'/'FIN' GROUP"
	PRINT "              (DROPS FROM 'IF' TO 'ELSE'/'FIN' INCLUSIVE;"
	PRINT "              RETAINS 'ELSE' PART AS UNCONDITIONAL)"
	PRINT "U	CONVERT CONDITIONAL TO UNCONDITIONAL"
	PRINT "              DROPS THE 'IF','ELSE' AND 'FIN' LINES"
	PRINT "              DROPS THE CONTENTS OF THE 'ELSE' PART"
	PRINT "C        ALLOWS CONDITION TO BE CHANGED; PROGRAM WILL ASK FOR NEW CONDITION"

	PRINT
	PRINT
	INPUT "FILE TO STRIP: " FILE$
	OPEN #IN,FILE$
	INPUT "PUT RESULTS INTO: " FILE$
	CREATE #OUT,FILE$

1000	REM KEEP TEXT UNTIL ELSE OR FIN
	INPUT #IN,LINE$
	IF EOF(IN) THEN STOP
1005	IF LEN(LINE$)>=1 AND LINE$(1)=:C
		 THEN PRINT #OUT,LINE$(1,1)\
			LINE$=RIGHT$(LINE$,2)\
			GOTO 1005
	IF LEN(LINE$)>=3 AND LINE$(1,3)="	IF" THEN 1100
	IF LEN(LINE$)>=5 AND LINE$(1,5)="	ELSE" THEN RETURN
	IF LEN(LINE$)>=4 AND LINE$(1,4)="	FIN" THEN RETURN
	PRINT #OUT,LINE$
	GOTO 1000

1100	REM ENCOUNTERED 'IF' IN UNSKIPPED TEXT
	PRINT LINE$
1105	INPUT "KEEP? " ANS$
	IF ANS$="U" THEN 1200
	IF ANS$="D" THEN 1300
	IF ANS$="C" THEN 1400
	IF ANS$<>"" THEN 1105
1110	REM RETAIN CONDITIONAL AS IS
	PRINT #OUT,LINE$
1115	GOSUB 1000
	PRINT #OUT,LINE$
	IF LINE$(1,4)="	FIN" THEN 1000
	REM MUST BE ELSE
	GOSUB 1000
	PRINT #OUT,LINE$
	GOTO 1000

1200	REM MAKE CONDITIONAL STUFF UNCONDITIONAL
	GOSUB 1000
	IF LINE$(1,4)="	FIN" THEN 1000
	REM MUST BE ELSE
	GOSUB 2000
	GOTO 1000

1300	REM DROP CONDITIONAL ALTOGETHER
	GOSUB 2000
	IF LINE$(1,4)="	FIN" THEN 1000
	REM MUST BE ELSE
	GOSUB 1000
	GOTO 1000

1400 REM CHANGE CONDITIONAL
	INPUT "NEW CONDITION:    IF   " LINE$
	PRINT #OUT,"	IF	";LINE$
	GOTO 1115

2000	REM SKIP TEXT UNTIL ELSE OR FIN ENCOUNTERED
	INPUT #IN,LINE$
	IF EOF(IN) THEN PRINT "NESTING ERROR!!"\STOP
2005	IF LEN(LINE$)>=1 AND LINE$(1)=:C
		THEN LET LINE$=RIGHT$(LINE$,2)\
			GOTO 2005
	IF LEN(LINE$)>=3 AND LINE$(1,3)="	IF" THEN 2100
	IF LEN(LINE$)>=5 AND LINE$(1,5)="	ELSE" THEN RETURN
	IF LEN(LINE$)>=4 AND LINE$(1,4)="	FIN" THEN RETURN
	GOTO 2000

2100	REM SKIP NESTED IF
	GOSUB 2000
	IF LINE$(1,4)="	FIN" THEN 2000
	REM MUST BE ELSE CLAUSE
	GOSUB 2000
	GOTO 2000

	END
