unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Grids;
type
TForm1 =
class(TForm)
Edit1: TEdit;
Button1: TButton;
Button2: TButton;
Button3: TButton;
Button4: TButton;
Button5: TButton;
Edit3: TEdit;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Edit2: TEdit;
StringGrid1: TStringGrid;
Label5: TLabel;
procedure Button4Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure Button1Click(Sender: TObject);
procedure Button6Click(Sender: TObject);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
Tabrechnung =
RECORD
name :
string;
kosten : real;
quit :
string;
end;
var
Form1: TForm1;
abrechnung : Tabrechnung;
i,n,c : integer;
implementation
{$R *.dfm}
procedure TForm1.Button4Click(Sender: TObject);
begin
close;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
StringGrid1.RowCount := 2;
StringGrid1.ColCount := 4;
StringGrid1.Cells[0,0] := '
Nummer';
StringGrid1.Cells[1,0] := '
Name';
StringGrid1.Cells[2,0] := '
Kosten';
StringGrid1.Cells[3,0] := '
Quittung';
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
i := 1;
n := 1;
c := 0;
abrechnung.
name := Edit2.Text;
abrechnung.kosten := strtofloat(Edit1.Text);
abrechnung.quit := Edit3.Text;
StringGrid1.Cells[0,n] := inttostr(n);
StringGrid1.Cells[i,n] := abrechnung.
name;
i := i+1;
StringGrid1.Cells[i,n] := floattostr(abrechnung.kosten);
i := i+1;
StringGrid1.Cells[i,n] := abrechnung.quit;
n := n+1;
i := i-2;
Label5.Caption := inttostr(n);
StringGrid1.
end;
end.