Changeset 12 for trunk/Packages/Common
- Timestamp:
- Apr 2, 2016, 11:08:30 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Packages/Common/UCommon.pas
r4 r12 65 65 procedure FreeThenNil(var Obj); 66 66 function RemoveQuotes(Text: string): string; 67 function LoadFileToStr(const FileName: TFileName): AnsiString; 67 68 68 69 … … 448 449 end; 449 450 451 function LoadFileToStr(const FileName: TFileName): AnsiString; 452 var 453 FileStream: TFileStream; 454 Read: Integer; 455 begin 456 Result := ''; 457 FileStream := TFileStream.Create(FileName, fmOpenRead); 458 try 459 if FileStream.Size > 0 then begin 460 SetLength(Result, FileStream.Size); 461 Read := FileStream.Read(Pointer(Result)^, FileStream.Size); 462 SetLength(Result, Read); 463 end; 464 finally 465 FileStream.Free; 466 end; 467 end; 450 468 451 469 initialization
Note:
See TracChangeset
for help on using the changeset viewer.