Ignore:
Timestamp:
Aug 10, 2010, 11:54:18 AM (14 years ago)
Author:
george
Message:

Added support for multiple source files and compilations for multiple modules in Project.pas

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/DelphiToC/USourceCode.pas

    r53 r54  
    279279  end;
    280280
     281  { TModuleList }
     282
     283  TModuleList = class(TObjectList)
     284    function Search(Name: string): TModule;
     285  end;
     286
    281287  TProgram = class
    282288    Device: TDevice;
    283     Modules: TObjectList; // TObjectList<TModule>
     289    Modules: TModuleList;
    284290    constructor Create;
    285291    destructor Destroy; override;
     
    321327begin
    322328  Device := TDevice.Create;
    323   Modules := TObjectList.Create;
     329  Modules := TModuleList.Create;
    324330end;
    325331
     
    677683end;
    678684
     685{ TModuleList }
     686
     687function TModuleList.Search(Name: string): TModule;
     688var
     689  I: Integer;
     690begin
     691  I := 0;
     692  while (I < Count) and (LowerCase(TModule(Items[I]).Name) <> LowerCase(Name)) do Inc(I);
     693  if I < Count then Result := TModule(Items[I]) else Result := nil;
     694end;
     695
    679696end.
    680697
Note: See TracChangeset for help on using the changeset viewer.