Changeset 108 for trunk/Packages/Common


Ignore:
Timestamp:
Feb 11, 2022, 11:31:42 AM (3 years ago)
Author:
chronos
Message:
  • Fixed: Do not update interface in contact properties if the listview doesn't have handle yet.
  • Added: Synced update of full name and name parts in contact form.
  • Modified: Improved image loading code by image format.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Packages/Common/UCommon.pas

    r98 r108  
    1313type
    1414  TArrayOfByte = array of Byte;
    15   TArrayOfString = array of string;
    1615  TExceptionEvent = procedure(Sender: TObject; E: Exception) of object;
    1716
     
    5150function ComputerName: string;
    5251procedure DeleteFiles(APath, AFileSpec: string);
     52function Explode(Separator: Char; Data: string): TStringArray;
    5353procedure ExecuteProgram(Executable: string; Parameters: array of string);
    5454procedure FileDialogUpdateFilterFileType(FileDialog: TOpenDialog);
     
    6565function LoadFileToStr(const FileName: TFileName): AnsiString;
    6666function LoggedOnUserNameEx(Format: TUserNameFormat): string;
    67 function MergeArray(A, B: array of string): TArrayOfString;
     67function MergeArray(A, B: array of string): TStringArray;
    6868function OccurenceOfChar(What: Char; Where: string): Integer;
    6969procedure OpenWebPage(URL: string);
     
    291291end;
    292292
    293 function Explode(Separator: char; Data: string): TArrayOfString;
    294 begin
    295   Result := nil;
    296   SetLength(Result, 0);
    297   while Pos(Separator, Data) > 0 do begin
    298     SetLength(Result, Length(Result) + 1);
    299     Result[High(Result)] := Copy(Data, 1, Pos(Separator, Data) - 1);
    300     Delete(Data, 1, Pos(Separator, Data));
    301   end;
     293function Explode(Separator: Char; Data: string): TStringArray;
     294var
     295  Index: Integer;
     296begin
     297  Result := Default(TStringArray);
     298  repeat
     299    Index := Pos(Separator, Data);
     300    if Index > 0 then begin
     301      SetLength(Result, Length(Result) + 1);
     302      Result[High(Result)] := Copy(Data, 1, Index - 1);
     303      Delete(Data, 1, Index);
     304    end else Break;
     305  until False;
    302306  SetLength(Result, Length(Result) + 1);
    303307  Result[High(Result)] := Data;
     
    509513end;
    510514
    511 function MergeArray(A, B: array of string): TArrayOfString;
    512 var
    513   I: Integer;
    514 begin
    515   Result := Default(TArrayOfString);
     515function MergeArray(A, B: array of string): TStringArray;
     516var
     517  I: Integer;
     518begin
     519  Result := Default(TStringArray);
    516520  SetLength(Result, Length(A) + Length(B));
    517521  for I := 0 to Length(A) - 1 do
Note: See TracChangeset for help on using the changeset viewer.