Ignore:
Timestamp:
Feb 27, 2010, 2:57:14 PM (15 years ago)
Author:
george
Message:
  • Upraveno: Oddělení zpracování parametrů volání do samostatné metody.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • tools/dbc_export/DBCExport.pas

    r338 r339  
    1414  { TDBCExport }
    1515  TDBCExport = class(TCustomApplication)
     16  private
     17    procedure ParseParameters;
    1618  protected
    1719    procedure DoRun; override;
     
    3133{ TDBCExport }
    3234
    33 procedure TDBCExport.DoRun;
     35procedure TDBCExport.ParseParameters;
    3436begin
    35   // Parse parameters
    3637  if HasOption('h', 'help') then begin
    3738    WriteHelp;
     
    6869    Database.Hostname := GetOptionValue('t', 'host');
    6970  end else Database.Hostname := 'localhost';
     71end;
    7072
    71 
     73procedure TDBCExport.DoRun;
     74begin
     75  ParseParameters;
    7276  ShowDBC;
    7377
     
    8084  inherited Create(TheOwner);
    8185  StopOnException := True;
    82   Database := TSqlDatabase.Create;;
     86  Database := TSqlDatabase.Create;
    8387end;
    8488
     
    129133      end;
    130134
    131       WriteLn('Save');
    132135      SaveToFile(NewDBCFileName);
    133136    end else WriteLn('File ' + DBCFileName + ' not exists.');
     
    139142  Application: TDBCExport;
    140143
    141 {$IFDEF WINDOWS}{$R project1.rc}{$ENDIF}
     144{$IFDEF WINDOWS}{$R DBCExport.rc}{$ENDIF}
    142145
    143146{$R DBCExport.res}
Note: See TracChangeset for help on using the changeset viewer.