REM SCAN
INPUT "FILENAME: ";FILENAME$
FILEOUT$="LIST.FIL"
DIM FLAGS(20)
DIM FIRST$(20),LAST$(20),ADDRESS$(20),CITY$(20)
DIM ZIP$(20),AREA$(20),TEL$(20)
K=20
OUTCNT=0
COUNTER=0
FILE FILENAME$
FILE FILEOUT$
10 REM
FOR J=1 TO 20
FLAGS(J)=0
NEXT J
FOR J=1 TO 20
READ #1; LAST$(J),FIRST$(J),ADDRESS$(J),CITY$(J),ZIP$(J),AREA$(J),TEL$(J)
IF LAST$(J)="END" THEN 20
COUNTER=COUNTER+1
NEXT J
20 GOSUB 65
33 REM
PRINT
PRINT "0 -->END PAGE / 1-20 -->EXTRACT ITEM / 21 -->RESTART"
35 REM
INPUT ANSWER
IF ANSWER = 0 THEN 40
IF ANSWER = 21 THEN 55
IF ANSWER > 20 THEN 35
IF ANSWER <1 THEN 35
FLAGS(ANSWER)=1
GOTO 35
40 REM
FOR J=1 TO K
IF FLAGS(J) = 0 THEN 45
PRINT #2; LAST$(J),FIRST$(J),ADDRESS$(J),CITY$(J),ZIP$(J),AREA$(J),TEL$(J)
OUTCNT=OUTCNT+1
45 IF LAST$(J)="END" THEN 22
NEXT J
GOTO 10
55 REM
FOR J=1 TO 20
FLAGS(J)=0
NEXT J
GOSUB 65
GOTO 33
65 REM LIST
PRINT CHR$(26)
FOR J=1 TO 20
IF LAST$(J)="END" THEN 70
PRINT J;": ";LAST$(J);"/";FIRST$(J);TAB(27);ADDRESS$(J);TAB(55);CITY$(J)
NEXT J
70 RETURN
22 REM END OF JOB ROUTINE
PRINT #2; "END","END","END","END"
PRINT "END OF LIST"
PRINT COUNTER;" INPUT ITEMS"
PRINT OUTCNT;" OUTPUT ITEMS"
END