home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / PASCAL / FORUM25C.ZIP / MAILCON.PAS < prev    next >
Encoding:
Pascal/Delphi Source File  |  1988-12-27  |  1.3 KB  |  57 lines

  1. TYPE Mstr = String[30];
  2.  
  3. TYPE mailrec = RECORD
  4.        title,
  5.        sentby    : mstr;
  6.        when      : longint;
  7.        anon,
  8.        read      : boolean;
  9.        sentto,
  10.        line,
  11.        fileindex : integer
  12. {       AnonPost  : BOOLEAN;   }
  13.      End;
  14.  
  15.      Ext_mailRec = RECORD
  16.        title,
  17.        sentby    : mstr;
  18.        when      : longint;
  19.        anon,
  20.        read      : boolean;
  21.        sentto,
  22.        line,
  23.        fileindex : integer;
  24.        AnonPost  : BOOLEAN;
  25.      End;
  26.  
  27. VAR Mail1 : FILE OF MailRec;
  28.     Mail2 : FILE Of Ext_mailRec;
  29.     c1    : LONGINT;
  30.     Inrec : MailRec;
  31.     OutRec : Ext_mailRec;
  32.  
  33. Begin
  34.   Assign(Mail1,'MAIL');
  35.   Assign(Mail2,'NewMail');
  36.   Reset(Mail1);
  37.   Rewrite(Mail2);
  38.   For c1 := 0 TO FileSize(Mail1)-1 DO
  39.     Begin
  40.       Seek(Mail1,c1);
  41.       Read(Mail1,Inrec);
  42.       OutRec.title := InRec.Title;
  43.       OutRec.sentby := InRec.SentBy;
  44.       OutRec.when := inRec.When;
  45.       OutREc.anon := inRec.Anon;
  46.       Outrec.read := InRec.Read;
  47.       Outrec.sentto := InRec.Sentto;
  48.       Outrec.line := InRec.Line;
  49.       OutRec.fileindex := Inrec.FileIndex;
  50.       OutRec.AnonPost := FALSE;
  51.       Seek(Mail2,c1);
  52.       Write(Mail2,OutRec);
  53.       Write(c1,'  ');
  54.     End;
  55.   Close(Mail1);
  56.   Close(Mail2);
  57. End.