hey,
ich hab ne frage... ich hab hier ein Programm geschrieben bzw. 2 in einem und jetzt hab ich ne frage zu der repeatschleife... kann man die irgendwie in if then schleife umschreiben? oder habt ihr ne idee wo ich irgendwo ne if then bedingung einbauen kann!? m[/delphi]fg FlaVa
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:
| procedure TForm1.Button1Click(Sender: TObject);
Var a,b,ausgabe : Integer;
Begin
a := strtoint(edit1.text); b := strtoint(edit2.text); ausgabe := 1;
repeat begin
a := a * b; b := b - 1;
memo1.lines.add(inttostr(ausgabe)+'. Ableitung : f(x)='+inttostr(a)+'*xˆ'+inttostr(b)); ausgabe:=ausgabe+1;
end; until b = 0;
end;
procedure TForm1.Button2Click(Sender: TObject);
var x,y,a,b:integer;
begin randomize; x := Random(10)+1; y := Random(10)+1;
Memo2.text:=inttostr(x); Memo3.text:=inttostr(y);
end;
procedure TForm1.Button3Click(Sender: TObject); begin Memo1.text := (''); end;
end. |