80 IF B$ = "?" THEN PRINT : INPUT "Enter Text String to Find "; AA$: GOSUB 760
85 IF B$ = "D" THEN PRINT : INPUT "Enter Date to Find (MMDD)"; AD$: IF LEN(AD$) > 4 THEN 85
90 IF INSTR("ADYHZKROFBT<>@?", B$) = 0 THEN PRINT "Valid responses are A,K,R,O,H,F,B,D,T,<,>,@, or X": GOTO 590
100 PRINT : INPUT "<H>ardcopy <F>ile or <D>isplay (H F or D) "; C$: CLS : GOSUB 630: GOSUB 610
110 IF C$ = "" THEN C$ = "D" ELSE IF INSTR("HhFfDd", C$) = 0 THEN 100
120 IF C$ = "F" THEN CLOSE 2: GOSUB 700: OPEN RPT$ FOR OUTPUT AS #2: PRINT #2, "W0RLI Mail Header Report Utility - WB2COY - "; DATE$; " - "; TIME$: PRINT #2, " ": PRINT #2, " Msg # NR Stat Size To From @ BBS Date Subject"
130 'IF C$="D" THEN PRINT" Msg # NR Stat Size To From @ BBS Date Subject"
140 IF C$ = "H" THEN LPRINT "W0RLI Mail Header Report Utility - WB2COY - Printed "; DATE$; " - "; TIME$: LPRINT : LPRINT " Msg # NR Stat Size To From @ BBS Date Subject"
150 CLOSE 1: OPEN "R", 1, A$, 512
160 FIELD 1, 2 AS RN$, 2 AS NR$, 2 AS MN$, 2 AS SZ$, 1 AS AT$, 1 AS AS$, 7 AS A2$, 7 AS A3$, 7 AS A4$, 7 AS A5$, 5 AS A6$, 7 AS A7$, 2 AS A8$, 80 AS A9$, 118 AS GB2$, 128 AS GB3$, 128 AS GB4$
170 FOR I = FIX((LOF(1) / 512) + 1) TO 1 STEP -1
180 GET 1, I
190 IF I < 1 THEN 200 ELSE IF C$ = "F" OR C$ = "H" THEN LOCATE 10, 26: PRINT "Processing Record # "; I
490 IF B$ = "A" AND (LEFT$(ST$, 1) <> "K" AND LEFT$(ST$, 1) <> "H") THEN GOSUB 660
500 IF B$ = AT$ AND LEFT$(ST$, 1) <> "K" THEN GOSUB 660
510 IF B$ = "Z" THEN GOSUB 660
520 IF LEFT$(ST$, 1) = B$ THEN GOSUB 660
530 IF (B$ = "<" AND FRCALL$ = CALLSIGN$) AND LEFT$(ST$, 1) <> "K" THEN GOSUB 660
540 IF (B$ = ">" AND TOCALL$ = CALLSIGN$) AND LEFT$(ST$, 1) <> "K" THEN GOSUB 660
550 IF (B$ = "@" AND BBS$ = CALLSIGN$) AND LEFT$(ST$, 1) <> "K" THEN GOSUB 660
560 IF B$ = "?" AND (INSTR(SUBJ$, AA$) <> 0 OR INSTR(SUBJ$, AB$) <> 0 OR INSTR(SUBJ$, AC$) <> 0 OR INSTR(SUBJ$, AD$) <> 0) AND LEFT$(ST$, 1) <> "K" THEN GOSUB 660
565 IF (B$ = "D" AND DAT$ = AD$) AND LEFT$(ST$, 1) <> "K" THEN GOSUB 660
620 IF B$ = "" THEN RETURN ELSE IF ASC(B$) > 96 AND ASC(B$) < 123 THEN B$ = CHR$(ASC(B$) - 32): RETURN ELSE RETURN
630 IF C$ = "" THEN RETURN ELSE IF ASC(C$) > 96 AND ASC(C$) < 123 THEN C$ = CHR$(ASC(C$) - 32): RETURN ELSE RETURN
640 FOR I = 1 TO LEN(CALLSIGN$): D$ = (MID$(CALLSIGN$, I, 1)): IF ASC(D$) > 96 AND ASC(D$) < 123 THEN MID$(CALLSIGN$, I, 1) = CHR$(ASC(D$) - 32): ELSE MID$(CALLSIGN$, I, 1) = CHR$(ASC(D$))
650 NEXT I: RETURN
660 IF (Y = 0 AND C$ = "D") THEN GOSUB 750 ELSE IF (Y = 20 AND C$ = "D") THEN GOSUB 820
670 Y = Y + 1: X = X + 1: IF C$ = "D" THEN PRINT MSG$; NUMR$; STATUS$; SIZE$; " "; TOCALL$; FRCALL$; BBS$; DAT$; " "; LEFT$(SUBJ$, 31): RETURN: ELSE IF C$ = "H" THEN GOSUB 680: RETURN: ELSE IF C$ = "F" THEN GOSUB 690: RETURN ELSE RETURN
700 RPT$ = "RLIMAIL.RPT": IF INSTR("<>@", B$) > 0 THEN RPT$ = CALS$ + ".RPT"
710 IF B$ = "K" THEN RPT$ = "RLI-KILL.RPT" ELSE IF B$ = "A" THEN RPT$ = "RLI-ACT.RPT" ELSE IF B$ = "O" THEN RPT$ = "RLI-OLD.RPT" ELSE IF B$ = "R" THEN RPT$ = "RLIREAD.RPT" ELSE IF B$ = "H" THEN RPT$ = "RLI-HELD.RPT"
715 IF B$ = "B" THEN RPT$ = "RLI-BULL.RPT"
720 IF B$ = "T" THEN RPT$ = "RLI-NTS.RPT" ELSE IF B$ = "F" THEN RPT$ = "RLI-FWD.RPT" ELSE IF B$ = "Y" THEN RPT$ = "RLI-READ.RPT"
730 PRINT " Writing Records to file: "; RPT$
740 RETURN
750 PRINT " Msg # NR Stat Size To From @ BBS Date Subject": RETURN
760 AB$ = AA$: FOR I = 1 TO LEN(AB$): D$ = (MID$(AB$, I, 1)): IF ASC(D$) > 96 AND ASC(D$) < 123 THEN MID$(AB$, I, 1) = CHR$(ASC(D$) - 32): ELSE MID$(AB$, I, 1) = CHR$(ASC(D$))
770 NEXT I
780 AC$ = AA$: FOR I = 1 TO LEN(AC$): D$ = (MID$(AC$, I, 1)): IF ASC(D$) > 64 AND ASC(D$) < 91 THEN MID$(AC$, I, 1) = CHR$(ASC(D$) + 32): ELSE MID$(AC$, I, 1) = CHR$(ASC(D$))
790 NEXT I
800 AD$ = AC$: D$ = (LEFT$(AD$, 1)): IF ASC(D$) > 96 AND ASC(D$) < 123 THEN MID$(AD$, 1) = CHR$(ASC(D$) - 32)
810 RETURN
820 PRINT : PRINT " <Any Key to Continue - Q to Quit>"
830 Z$ = INKEY$: IF Z$ = "" THEN 830 ELSE IF Z$ = "Q" OR Z$ = "q" THEN 580 ELSE Y = 1: CLS : GOSUB 610: GOSUB 750: RETURN