Einzelnen Beitrag anzeigen

Borschti

Registriert seit: 1. Nov 2007
Ort: Marburg Lahn
235 Beiträge
 
Delphi 2007 Professional
 
#14

Re: function für mehrere Units?

  Alt 3. Mär 2008, 17:20
okay dann hier mal die code fragmente

Delphi-Quellcode:
unit Main;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, Menus, GIFImg, ExtCtrls, Grids;
   procedure ProcessGrid (Grid: TStringGrid ; ActionId: Integer);
type
//...


  private
    { Private-Deklarationen }
  public
    { Public-Deklarationen }
  end;

var
  Form5: TForm5;

implementation

uses BList, BListK, Kndst, KndstK, Eink, EinkK, Verk, VerkK, KursT, KursTK;

{$R *.dfm}

 procedure addmon (Grid: TStringGrid);
 var i : Integer;
    b : String;
 begin
  
 i := 0;

 Form4.StringGrid1.RowCount := Form4.StringGrid1.RowCount +1;

 for i := 1 to Form4.Stringgrid1.rowcount - 1 do
  begin
    b := IntToStr(i);
    Form4.Stringgrid1.Cells[0,i] := (b + '. Monat');
  end
end;
//...
procedure ProcessGrid (Grid: TStringGrid ; ActionId: Integer);
begin
  case ActionId of
    1: addmon (Grid);
    //2: adddrug (Grid);
    //3: killcol (Grid);
   end;
end;

end.
Andere Unit

Delphi-Quellcode:

unit EinkK;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, Unit8, Grids;

type

//...
var
  Form13: TForm13;

implementation
uses Main, BList, BListK, Kndst, KndstK, Eink, Verk, VerkK;
{$R *.dfm}

procedure TForm13.ColorButton2Click(Sender: TObject);
begin
ColorDialog1.Execute;
Form11.StringGrid1.Color := ColorDialog1.Color;
end;

procedure TForm13.ColorButton3Click(Sender: TObject);
begin
form13.close;
end;

procedure TForm13.ColorButton4Click(Sender: TObject);
begin
FontDialog1.Execute;
Form11.StringGrid1.Font := FontDialog1.Font;
end;

procedure TForm13.ColorButton6Click(Sender: TObject);
begin

ProcessGrid (TStringGrid, 1); //<--- Hier tritt der Fehler Auf



end;

end.
  Mit Zitat antworten Zitat