Changeset 5 for trunk/Car.pas
- Timestamp:
- Jul 8, 2024, 11:31:59 PM (5 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Car.pas
r4 r5 98 98 destructor Destroy; override; 99 99 procedure LoadFromFile(FileName: string); 100 procedure LoadFromStrings(Lines: TStrings); 100 101 function Print: string; 101 102 property OnLog: TLogEvent read FOnLog write FOnLog; … … 388 389 procedure TSummary.LoadFromFile(FileName: string); 389 390 var 390 I: Integer;391 391 Lines: TStringList; 392 begin 393 Lines := TStringList.Create; 394 try 395 Lines.LoadFromFile(FileName); 396 LoadFromStrings(Lines); 397 finally 398 Lines.Free; 399 end; 400 end; 401 402 procedure TSummary.LoadFromStrings(Lines: TStrings); 403 var 404 I: Integer; 392 405 Line: string; 393 406 CarComparer: TCarComparer; … … 426 439 TableLineCellSeparator = '||'; 427 440 begin 428 Lines := TStringList.Create;429 Lines.LoadFromFile(FileName);430 441 for I := 0 to Lines.Count - 1 do begin 431 442 Line := Lines[I]; … … 539 550 SaveAndFreeCar(CarName, EngineType, CompanyName, Distance, Odometer, Price, 540 551 PriceWithFuel, RentTime, Consumption); 541 Lines.Free;542 552 CarComparer := TCarComparer.Create; 543 553 Cars.Sort(CarComparer);
Note:
See TracChangeset
for help on using the changeset viewer.