Changeset 510 for Common/UCommon.pas


Ignore:
Timestamp:
Apr 11, 2018, 11:22:58 AM (7 years ago)
Author:
chronos
Message:
  • Added: Basic TStringTable class.
  • Fixed: Removed various compiler warnings.
Location:
Common
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • Common

    • Property svn:ignore
      •  

        old new  
        11lib
        22backup
         3*.lrj
  • Common/UCommon.pas

    r509 r510  
    7474procedure SearchFiles(AList: TStrings; Dir: string;
    7575  FilterMethod: TFilterMethodMethod);
     76function GetStringPart(var Text: string; Separator: string): string;
    7677
    7778
     
    531532    try
    532533      repeat
    533         if (SR.Name = '.') or (SR.Name = '..') or not FilterMethod(SR.Name) then Continue;
     534        if (SR.Name = '.') or (SR.Name = '..') or not FilterMethod(SR.Name) or
     535          not FilterMethod(Copy(Dir, 3, Length(Dir)) + SR.Name) then Continue;
    534536        AList.Add(Dir + SR.Name);
    535537        if (SR.Attr and faDirectory) <> 0 then
     
    541543end;
    542544
     545function GetStringPart(var Text: string; Separator: string): string;
     546var
     547  P: Integer;
     548begin
     549  P := Pos(Separator, Text);
     550  if P > 0 then begin
     551    Result := Copy(Text, 1, P - 1);
     552    Delete(Text, 1, P - 1 + Length(Separator));
     553  end else begin
     554    Result := Text;
     555    Text := '';
     556  end;
     557  Result := Trim(Result);
     558  Text := Trim(Text);
     559end;
     560
     561
    543562
    544563initialization
Note: See TracChangeset for help on using the changeset viewer.