home *** CD-ROM | disk | FTP | other *** search
- Script Cixmail; (* Version 1.10 by Michael Spalter *)
- VAR
- Name : ARRAY[0..100] OF STRING; (* Will handle 100 names *)
- Outward : ARRAY[0..100] OF INTEGER;
- Inward : ARRAY[0..100] OF INTEGER;
- Fhandle : INTEGER;
- Different : INTEGER;
- Round : INTEGER; (* NOTE: This is not a very useful script ! *)
- Start : INTEGER; (* It is designed to show string and integer *)
- Done : INTEGER; (* Arrays, file handling and various loops *)
- Line : STRING[80]; (* and other constructions. *)
- Out : BOOLEAN; (* so, even if you're not a TP user, this *)
- BEGIN (* script may be useful for reference..... *)
- ClrScr;
- WrLn('┌──────────────────────────────────────────────┐');
- WrLn('│ CixMail For Deputy & Telepathy Mail Files │');
- WrLn('└──────────────────────────────────────────────┘\n');
- WrLn('This program will sort through your Telepathy mail file');
- WrLn('and then give a complete list of everyone who has sent');
- WrLn('you mail and everyone who you have sent mail to. ');
- WrLn('\nProcessing Cix mail file.....Please be patient.\n');
- WrLn('< PRESS ANY KEY TO STOP >\r\n');
- Escape(FALSE);
- Different:=0;
- FHandle:=FOPEN('\messages');
- IF Fhandle=-1 THEN
- Write('\rMail file not found !!!!\r\n\n');
- HaltScript;
- END;
- WHILE (NOT FEOF(FHandle)) AND (NOT KeyPressed) DO
- FRead(FHandle,Line);
- IF (Slice(Line,0,5)="From:") OR (Slice(Line,0,3)="To:") THEN
- IF Slice(Line,0,5)="From:" THEN Out:=FALSE ELSE Out:=TRUE; END;
- IF Out=TRUE THEN Start:=4; ELSE Start:=6; END;
- Line:=Slice(Line,Start,(POS(Line,'.')-Start));
- INC(Done);
- Write('Processed: ',Done,' messages. Current: ',Line);
- IF Out THEN Write(' (Outward)'); ELSE Write('(Inward)'); END;
- Write(' ');
- GotoXY(0,WhereY);
- Round:=0;
- REPEAT
- INC(Round);
- UNTIL (Line=Name[Round]) OR (Round>Different);
- IF Round>Different THEN
- Name[Round]:=Line;
- INC(Different);
- END;
- IF Out=TRUE THEN
- INC(Outward[Round]); ELSE
- INC(Inward[Round]);
- END;
- END;
- END;
- FClose(Fhandle);
- ClrScr;
- WrLn;
- Write('Cix/Telepathy Mail Statistics OUT IN\n\r');
- Write('----------------------------- --------\n\r');
- FHandle:=FCreate('names.txt');
- FWriteLn(FHandle,'To From Cix ID');
- FWriteLn(FHandle,'-----------------------');
- FOR Round:=1 TO Different DO
- Fwrite(FHandle,Outward[Round]);
- FWrite(FHandle,' ');
- Fwrite(FHandle,Inward[Round]);
- FWrite(FHandle,' ');
- FWriteLn(FHandle,Name[Round]);
- Write(Name[Round]);
- GotoXY(42,WhereY); Write(Outward[Round]);
- GotoXY(47,WhereY); Write(Inward[Round]); WrLn;
- END;
- FClose(Fhandle);
- WrLn('\r\nTime Taken: ',ScriptTime,' seconds.');
- Write('Results have been written to file "names.txt"\n\r\n');
- END CixMail.
-