Thema: Delphi problem mit for-schleife

Einzelnen Beitrag anzeigen

Benutzerbild von Neutral General
Neutral General

Registriert seit: 16. Jan 2004
Ort: Bendorf
5.219 Beiträge
 
Delphi 10.2 Tokyo Professional
 
#3

Re: problem mit for-schleife

  Alt 6. Okt 2006, 17:36
Delphi-Quellcode:
procedure TForm1.Button1Click(Sender: TObject);
var i:integer;
begin
for i:=1 to 5 do
  x:= f(i);
  Label4.Caption := FloatToStr(x); // Diese Zeile wird NICHT wiederholt !
end;
1. Siehe Quelltext
2. Siehe Quelltext:

Label4.Caption := Label4.Caption + 'f(' + IntToStr(i) + ')= ' + FloatToStr(x) + #13#10; 1+2 =>

Delphi-Quellcode:
procedure TForm1.Button1Click(Sender: TObject);
var i:integer;
begin
for i:=1 to 5 do
begin
  x:= f(i);
  Label4.Caption := Label4.Caption + 'f(' + IntToStr(i) + ')= ' + FloatToStr(x) + #13#10;
end;
end;
So würd ichs eventuell machen

Gruß
Neutral General
Michael
"Programmers talk about software development on weekends, vacations, and over meals not because they lack imagination,
but because their imagination reveals worlds that others cannot see."
  Mit Zitat antworten Zitat