1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: 64: 65: 66: 67: 68: 69: 70: 71: 72: 73: 74: 75: 76: 77: 78: 79: 80: 81: 82: 83: 84: 85: 86: 87: 88: 89: 90: 91: 92: 93: 94: 95: 96: 97: 98: 99: 100: 101: 102: 103: 104: 105: 106: 107: 108: 109: 110: 111: 112: 113: 114: 115: 116: 117: 118: 119: 120: 121: 122: 123: 124: 125: 126: 127: 128: 129: 130: 131: 132: 133: 134: 135: 136: 137: 138: 139: 140: 141: 142: 143: 144: 145: 146: 147: 148: 149:
| nit Kundendatei;
interface
uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, Grids;
type TForm1 = class(TForm) StringGrid1: TStringGrid; Button1: TButton; Button2: TButton; Label1: TLabel; Edit1: TEdit; Label2: TLabel; procedure FormCreate(Sender: TObject); procedure Button2Click(Sender: TObject); procedure Button1Click(Sender: TObject);
private public
end;
var Form1: TForm1;
implementation
uses Unit2;
{$R *.dfm}
procedure TForm1.FormCreate(Sender: TObject); var
i:integer; a:integer ; begin i:=0; a:=0; repeat i:=i+1; a:=a+1; stringgrid1.Cells[0,i]:=floattostr(a); edit1.Text:=formatfloat ('.000',a); until i+1>11;
stringgrid1.Cells[1,0]:='Kundenname'; stringgrid1.cells[2,0]:='Kundennummer'; stringgrid1.Cells[3,0]:='Rechnungsbetrag' ;
stringgrid1.Cells[3,1]:='23'; stringgrid1.Cells[3,2]:='1'; stringgrid1.Cells[3,3]:='22'; stringgrid1.Cells[3,4]:='4'; stringgrid1.Cells[3,5]:='6'; stringgrid1.Cells[3,6]:='15'; stringgrid1.Cells[3,7]:='66'; stringgrid1.Cells[3,8]:='22';
end;
procedure TForm1.Button2Click(Sender: TObject); begin close; end;
procedure TForm1.Button1Click(Sender: TObject); var u:integer ; a:integer ; j:integer; begin u:=1; a:=1; j:=0; repeat j:= j+1; if form1.stringgrid1.Cells[3,j] > form1.edit1.Text then u:= u+1; if form1.stringgrid1.cells[3,j]>form1.edit1.text then begin form2.stringgrid1.cells [1,a]:=form1.stringgrid1.cells [1,j]; form2.stringgrid1.cells [2,a]:=form1.stringgrid1.cells [2,j]; form2.stringgrid1.cells [3,a]:=form1.stringgrid1.cells [3,j]; a:=a+1; end;
until j>11 ; form2.stringgrid1.RowCount:=u; form2.show; end;
end.
unit Unit2;
interface
uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, Grids;
type TForm2 = class(TForm) StringGrid1: TStringGrid; Button1: TButton; procedure FormCreate(Sender: TObject); private public end;
var Form2: TForm2;
implementation
{$R *.dfm}
procedure TForm2.FormCreate(Sender: TObject); var i,a: integer; begin i:=0; a:=0; repeat i:=i+1; a:=a+1; stringgrid1.Cells[0,i]:=floattostr(a);
until i+1>11; stringgrid1.Cells[1,0]:='Kundenname'; stringgrid1.cells[2,0]:='Kundennummer'; stringgrid1.Cells[3,0]:='Rechnungsbetrag'; end;
end. |