home *** CD-ROM | disk | FTP | other *** search
/ Oakland CPM Archive / oakcpm.iso / cpm / bbs / turbobbs.ark / MAILSYS.FIX < prev    next >
Text File  |  1986-12-20  |  1KB  |  32 lines

  1. procedure messagesearch(first:byte; fromnum, tonum:integer; sectnum:byte);
  2.  
  3.   var
  4.     loop: byte;
  5.     inch: char;
  6.     oldnum: integer;
  7.     matched: boolean;
  8.  
  9.   begin
  10.     matched := false;
  11.     inch := null;
  12.     loop := first;
  13.     if loop = 0 then loop := 1;
  14.     while cts and (loop <= count) and (inch <> 'Q') and (count <> 0) do begin
  15.       oldnum := messtable[loop].number;
  16.       if ((fromnum = 0) or (fromnum = messtable[loop].sender))
  17.         and ((tonum = 0) or (tonum = messtable[loop].recver))
  18.         and ((sectnum = 0) or (sectnum = messtable[loop].section))
  19.         and not (secure(loop) and messtable[loop].private)
  20.       then begin
  21.         matched := true;
  22.         cancelled := false;
  23.         header(loop);
  24.         inch := getcap('Read (Y/N/Quit)? ');
  25.         if inch = 'Y' then readfile(loop);
  26.       end;
  27.       if messtable[loop].number = oldnum then loop := loop + 1;
  28.     end;
  29.     if cts and not matched then lineout('No messages found.');
  30.   end;
  31.  
  32.