Registriert seit: 23. Jun 2003
416 Beiträge
Delphi 2006 Professional
|
Re: Max. aus Stringgridspalte für Ausgabe anderen Zelleninha
8. Sep 2005, 12:02
Delphi-Quellcode:
procedure TForm1.Optimum(n: integer; out maximum: Double; out u: String);
var
i:integer;
leistung:double;
begin
maximum:=0;
with StringGrid1 do
for i:=1 to n do
begin
leistung:= StrToFloat(StringGrid1.Cells[3,i]);
if leistung > maximum then
begin
maximum:= leistung;
u := StringGrid1.Cells[1, i];
end;
end;
end;
procedure TForm1.Button7_opt_APClick(Sender: TObject);
var
maxwert: double;
n:integer;
u: String;
begin
n:= StrToInt(Edit3_Eingabe_anzahl.Text);
Optimum(n, maxwert, u);
Edit2_Optimum.Text:= FloatToStr(maxwert);
Edit_Spannung.Text := u;
end;
"Electricity is actually made up of extremely tiny particles called electrons, that you cannot see with the naked eye unless you have been drinking." (Dave Barry)
|