Einzelnen Beitrag anzeigen

Nuclear-Ping
(Gast)

n/a Beiträge
 
#9

Re: function für mehrere Units?

  Alt 3. Mär 2008, 16:26


Delphi-Quellcode:
unit Irgendwas;

interface

uses ...;

procedure ProcessGrid (Grid: TStringGrid; ActionId: Integer);

implementation

procedure AddSomething (Grid: TStringGrid);
begin
  // ...
end;

procedure ProcessGrid (Grid: TStringGrid; ActionId: Integer);
begin
  case ActionId of
    1: AddSomething (Grid);
    2: DeleteSomething (Grid);
    // ...
   end;
end;

end.
Delphi-Quellcode:
unit Unit1;

interface

uses ...;

type

  TForm1 = class(TForm)
    // ...
    procedure Button1Click (Sender: TObject);
  private
    // ...
  public
    // ...
  end;

var
  // ...

implementation

uses Irgendwas;

{$R *.dfm}

procedure TForm1.Button1Click (Sender: TObject);
begin
  ProcessGrid (StringGrid1, 1);
end;
Wie lange arbeitet ihr schon mit Delphi?
  Mit Zitat antworten Zitat