Changeset 574 for trunk/Packages/Common/Common.pas
- Timestamp:
- May 14, 2024, 5:18:30 PM (6 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Packages/Common/Common.pas
r554 r574 65 65 function GetFileFilterItemExt(Filter: string; Index: Integer): string; 66 66 function IntToBin(Data: Int64; Count: Byte): string; 67 function Implode(Separator: Char; List: TList<string>): string; 67 function Implode(Separator: string; List: TList<string>): string; 68 function Implode(Separator: string; List: TStringList; Around: string = ''): string; 68 69 function LastPos(const SubStr: String; const S: String): Integer; 69 70 function LoadFileToStr(const FileName: TFileName): AnsiString; … … 184 185 (*function DelTree(DirName : string): Boolean; 185 186 var 186 SHFileOpStruct : TSHFileOpStruct;187 DirBuf : array [0..255] of Char;187 SHFileOpStruct : TSHFileOpStruct; 188 DirBuf : array [0..255] of char; 188 189 begin 189 190 DirName := UTF8Decode(DirName); 190 191 try 191 Fill Char(SHFileOpStruct, Sizeof(SHFileOpStruct), 0);192 FillChar(DirBuf, Sizeof(DirBuf), 0 ) ;193 StrPCopy(DirBuf, DirName) ;192 Fillchar(SHFileOpStruct,Sizeof(SHFileOpStruct),0) ; 193 FillChar(DirBuf, Sizeof(DirBuf), 0 ) ; 194 StrPCopy(DirBuf, DirName) ; 194 195 with SHFileOpStruct do begin 195 196 Wnd := 0; … … 200 201 fFlags := fFlags or FOF_SILENT; 201 202 end; 202 Result := (SHFileOperation(SHFileOpStruct) = 0) ;203 Result := (SHFileOperation(SHFileOpStruct) = 0) ; 203 204 except 204 Result := False;205 Result := False; 205 206 end; 206 207 end;*) 208 209 function Implode(Separator: string; List: TStringList; Around: string = ''): string; 210 var 211 I: Integer; 212 begin 213 Result := ''; 214 for I := 0 to List.Count - 1 do begin 215 Result := Result + Around + List[I] + Around; 216 if I < List.Count - 1 then Result := Result + Separator; 217 end; 218 end; 207 219 208 220 function LastPos(const SubStr: String; const S: String): Integer; … … 314 326 end; 315 327 316 function Implode(Separator: Char; List: TList<string>): string;328 function Implode(Separator: string; List: TList<string>): string; 317 329 var 318 330 I: Integer;
Note:
See TracChangeset
for help on using the changeset viewer.