Autor Beitrag
Teddyman
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 32



BeitragVerfasst: Mi 31.03.04 10:03 
Hallo, habe folgende Frage:

Habe eine for-Schleife geschrieben, diese soll einen Schrittmotoren sieben mal ansprechen.
Aber die Schleife läuft nur einmal durch! Habe ich was falsch gemacht?`

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
procedure TForm1.Button1Click(Sender: TObject);
var zaehler : Integer;
begin
    for zaehler := 1 to 7 do
    wait(1000);
    _8132_start_a_move( 0,  1000,  0,    700,  0.1);
end;


grüße. danke.

Moderiert von user profile iconPeter Lustig: Delphi-Tags hinzugefügt und Topic verschoben
iGoA
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 103

Alle Win´s
D5 Prof
BeitragVerfasst: Mi 31.03.04 10:07 
Jo, Du musst Wait und Start_a_move in einem Begin-End-Block schreiben, sonst wird nur das Wait 7 mal ausgeführt.
Andi1982
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 497

WinXP HE
D6 Enterprise
BeitragVerfasst: Mi 31.03.04 11:44 
so wie du das machst, macht er nur das wait(1000) 7 mal durch!

du solltest es mal so probieren:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
procedure TForm1.Button1Click(Sender: TObject); 
var zaehler : Integer; 
begin 
    for zaehler := 1 to 7 do
    begin
        wait(1000); 
        _8132_start_a_move( 0,  1000,  0,    700,  0.1); 
    end;
end;


gruss andi

_________________
Solange die Bombe tickt ist alles in Ordnung, erst wenn sie damit aufhört wird es problematisch...