Table of Content
HAL Forum
function string GetRecordLink (
record TargetRecord)
Description:
Returns the RecordIdString for the specified record.
Parameters:
TargetRecord The record that we want the recordIdString for.
global
updating procedure TestAndDeleteMail(record MailVc Mailr)
begin
  LongInt i,rwcnt;
  row MailVc Mailrw;
  record RLinkVc RLr;
  string 255 rlink;
  
  rlink = GetRecordLink(Mailr);
  RLr.ToRecidStr = rlink;
  
  if (ReadFirstKey("ToRecKey",RLr,1,true)) then begin
    if (RLr.ToRecidStr==rlink) then begin
      goto out;
    end;
  end;
  
  rwcnt = MatRowCnt(Mailr);
  
  for (i = 0; i<rwcnt; i = i + 1) begin
    MatRowGet(Mailr,i,Mailrw);
    if (Mailrw.Mailbox<>-1 and Mailrw.AddrStatus==0) then begin
      goto out;
    end;
  end;
  
  RecordDelete(Mailr);
  DeleteAllMailRead(Mailr.SerNr);
  //DeleteAllMailAttach(Mailr.SerNr);  
  
out:;
  return;
end;
Related topics:
««