1
2
3
4
5 DIM ctrl%31,name%79:X%=ctrl%:Y%=X%DIV256
6 ON ERROR REPORT:PROCClose_All:PRINT:END
7 PROCexamine:PRINT
8 END
9 :
10 DEF PROCexamine:LOCAL idx%,f$
11 PRINT:VDU8:wid%=POS:VDU13:PRINT "Message Date From Subject";
12 REPEAT
13 f$=FNgbpb8(idx%):idx%=X%!9:IF f$<>"":PROCfile
14 UNTIL f$=""
15 ENDPROC
16 :
17 DEF PROCfile:LOCAL type%
18 type%=FNfile(f$,5):IF type%<>1:ENDPROC
19 date%=X%!15:in%=OPENIN(f$):IF in%=0:ENDPROC
20
21
22
23
24 :
25 to$="":from$="":date$="":subj$=""
26 A$=FNswap(GET$#in%,CHR$9," ")
27 IF LEFT$(A$,2)="To" :to$=FNs(MID$(A$,4)):IF LEFT$(to$,1)=":":to$=MID$(to$,3)
28 IF LEFT$(A$,4)="From":from$=FNs(MID$(A$,6)):IF LEFT$(from$,1)=":":from$=MID$(from$,3)
29 REPEAT
30 A$=FNswap(GET$#in%,CHR$9," ")
31 IF LEFT$(A$,4)="From":from$=FNs(MID$(A$,6)):IF LEFT$(from$,1)=":":from$=MID$(from$,3)
32 IF LEFT$(A$,4)="Date":date$=FNs(MID$(A$,6)):IF LEFT$(date$,1)=":":date$=MID$(date$,3)
33 IF LEFT$(A$,4)="Date":IF from$<>"":to$=""
34 IF LEFT$(A$,4)="Sent":date$=FNs(MID$(A$,6)):IF LEFT$(date$,1)=":":date$=MID$(date$,3)
35 IF LEFT$(A$,2)="RE" :subj$=FNs(MID$(A$,4)):IF LEFT$(subj$,1)=":":subj$=MID$(subj$,3)
36 IF LEFT$(A$,4)="Subj":subj$=FNs(MID$(A$,9)):IF LEFT$(subj$,7)="Subject":subj$=FNs(MID$(subj$,9))
37 UNTIL EOF#in% OR A$="":CLOSE#in%:in%=0
38 IF LEN date$=0:IF date%AND31:date$="xxx, "+FNd0(date%AND31,2)+" "+FNMon((date%AND&F00)DIV256)+" "+FNd0(1981+(date%AND&F000)DIV4096+(date%AND&E0)DIV2,4)
39 date$=FNDateFix(date$)
40 to$=FNswap(to$,"""","")
41 from$=FNswap(from$,"""","")
42 PRINT'f$;SPC(11-LEN f$);MID$(date$,6,11);" ";
43 A$=LEFT$(from$,11):IF to$<>"":A$="To:"+LEFT$(to$,8)
44 PRINT A$;SPC(12-LEN A$);LEFT$(subj$,wid%-34);
45 ENDPROC
46 :
47 DEF FNDateFix(A$)
48 IF LEN A$=11:=" "+A$ :
49 IF LEN A$=15:=LEFT$(A$,3)+","+MID$(A$,5) :
50 IF MID$(A$,15,1)=":":IF MID$(A$,18,1)=":":=" "+A$ :
51 IF MID$(A$,5,1)=" ":IF MID$(A$,7,1)=" ":A$=LEFT$(A$,5)+"0"+MID$(A$,6):
52 IF MID$(A$,8,2)=" ":A$=LEFT$(A$,8)+"0"+MID$(A$,10) :
53 IF MID$(A$,12,1)=" ":IF MID$(A$,15,1)=" ":A$=LEFT$(A$,12)+"19"+MID$(A$,13)
54 IF MID$(A$,14,1)=":":IF MID$(A$,17,1)=":":A$=LEFT$(A$,3)+", "+MID$(A$,9,2)+MID$(A$,4,5)+MID$(A$,21,4)+MID$(A$,11,9)+MID$(A$,25)
55 IF LEN A$=24:=LEFT$(A$,3)+","+MID$(A$,4) :
56 IF LEN A$>24:=A$ :
57 =A$
58 :
59 DEF FNswap(A$,m$,r$)
60 REPEAT:A%=INSTR(A$,m$):IF A%:A$=LEFT$(A$,A%-1)+r$+MID$(A$,A%+LEN m$)
61 UNTIL A%=0:=A$
62 :
63 DEF PROCClose_All
64 in%=in%:IF in%:A%=in%:in%=0:CLOSE#A%
65 ENDPROC
66 :
67 DEF FNfile(A$,A%):$name%=A$:?X%=name%:X%?1=name%DIV256:=(USR&FFDD)AND&FF
68 DEF FNgbpb8(ptr%)
69 IF HIMEM>&FFFF:!name%=0:SYS12,9,"",name%,1,ptr%,32TO,,,X%!5,X%!9:IF!name% OR X%!5=0:SYS70,name%TOA$:=A$
70 X%!1=name%:X%!5=1:X%!9=ptr%:A%=8:CALL&FFD1:IF X%!5=1:=""
71 A%=name%:A%?(1+?A%)=13:=FNs($(A%+1))
72 DEF FNMon(A%):=MID$("000JanFebMarAprMayJunJulAugSepOctNovDecDDDEEEFFF",A%*3+1,3)
73 DEF FNd0(A%,N%)=RIGHT$("00000000"+STR$ A%,N%)
74 DEF FNs(A$):IF LEFT$(A$,1)=" ":REPEAT A$=MID$(A$,2):UNTIL LEFT$(A$,1)<>" "
75 IF RIGHT$(A$,1)=" ":REPEAT A$=LEFT$(A$,LEN A$-1):UNTIL RIGHT$(A$,1)<>" "
76 =A$