Changeset 493 for Common/UCommon.pas
- Timestamp:
- Dec 10, 2016, 10:59:59 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Common/UCommon.pas
r492 r493 70 70 function GetDirCount(Dir: string): Integer; 71 71 function MergeArray(A, B: array of string): TArrayOfString; 72 function LoadFileToStr(const FileName: TFileName): AnsiString; 72 73 73 74 … … 492 493 end; 493 494 495 function LoadFileToStr(const FileName: TFileName): AnsiString; 496 var 497 FileStream: TFileStream; 498 Read: Integer; 499 begin 500 Result := ''; 501 FileStream := TFileStream.Create(FileName, fmOpenRead); 502 try 503 if FileStream.Size > 0 then begin 504 SetLength(Result, FileStream.Size); 505 Read := FileStream.Read(Pointer(Result)^, FileStream.Size); 506 SetLength(Result, Read); 507 end; 508 finally 509 FileStream.Free; 510 end; 511 end; 512 494 513 495 514
Note:
See TracChangeset
for help on using the changeset viewer.