Changeset 16 for trunk/UContact.pas


Ignore:
Timestamp:
Feb 28, 2018, 9:44:51 AM (6 years ago)
Author:
chronos
Message:
  • Added: New Tools action Find duplicates.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/UContact.pas

    r15 r16  
    3535    function AddNew(Name: string; Index: TContactFieldIndex; DataType:
    3636      TDataType): TContactField;
     37    procedure LoadToStrings(AItems: TStrings);
    3738  end;
    3839
     
    8889    ContactsFile: TContactsFile;
    8990    function Search(FullName: string): TContact;
     91    function ToString: ansistring; override;
    9092  end;
    9193
     
    132134end;
    133135
     136function TContacts.ToString: ansistring;
     137var
     138  I: Integer;
     139begin
     140  Result := '';
     141  for I := 0 to Count - 1 do begin
     142    if I > 0 then Result := Result + ', ';
     143    Result := Result + TContact(Items[I]).FullName;
     144  end;
     145end;
     146
    134147{ TContactFields }
    135148
     
    142155  Result.DataType := DataType;
    143156  Add(Result);
     157end;
     158
     159procedure TContactFields.LoadToStrings(AItems: TStrings);
     160var
     161  I: Integer;
     162begin
     163  while AItems.Count < Count do AItems.Add('');
     164  while AItems.Count > Count do AItems.Delete(AItems.Count - 1);
     165  for I := 0 to Count - 1 do
     166    AItems[I] := TContactField(Items[I]).Name;
    144167end;
    145168
Note: See TracChangeset for help on using the changeset viewer.