Changeset 2 for trunk/USource.pas
- Timestamp:
- Feb 2, 2011, 11:31:12 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/USource.pas
r1 r2 6 6 7 7 uses 8 Classes, SysUtils ;8 Classes, SysUtils, Contnrs; 9 9 10 10 type … … 12 12 13 13 TSource = class 14 Id: Integer; 14 15 Name: string; 15 16 SubversionURL: string; … … 19 20 end; 20 21 22 { TSourceList } 23 24 TSourceList = class(TObjectList) 25 function FindById(Id: Integer): TSource; 26 end; 27 21 28 implementation 29 30 { TSourceList } 31 32 function TSourceList.FindById(Id: Integer): TSource; 33 var 34 I: Integer; 35 begin 36 I := 0; 37 while (I < Count) and (TSource(Items[I]).Id <> Id) do Inc(I); 38 if I < Count then Result := TSource(Items[I]) 39 else Result := nil; 40 end; 22 41 23 42 end.
Note:
See TracChangeset
for help on using the changeset viewer.