var
  I: Integer;
begin
  for I:=0 to 7 do begin
    if GetTickCount - TimerTick > 200 then begin
      TimerTick := GetTickCount;
      Position := I;
    end;
  end;
怎么I一直为0?    想减慢速度都减慢不了吗?

解决方案 »

  1.   


    var
      I: Integer;
      TimerTick : Integer;
    begin
      for I:=0 to 7 do
      begin
        TimerTick := GetTickCount;
        repeat until GetTickCount - TimerTick > 200;
        Position := I;
      end;
      

  2.   


    sleep(2)
    application.ProcessMessages睡 2毫秒 看看
      

  3.   


    var
      I: Integer;
      TimerTick : Integer;
    begin
      for I:=0 to 7 do
      begin
        TimerTick := GetTickCount;
        repeat 
          Application.ProcessMessage;
        until GetTickCount - TimerTick > 200;
        Position := I;
      end;
    end;
      

  4.   

    楼上的正解,不过将Application.ProcessMessage改成
    Application.HandleMessage似乎应该更好一点,否则很耗CPU呵呵
      

  5.   

    var
      I: Integer;
    begin
      for I:=0 to 7 do begin
        if GetTickCount - TimerTick > 200 then begin
          TimerTick := GetTickCount;
          Position := I;
        end;
    caption := inttostr(i);
      end;这个 是没有 延长时间;但也不是你说的 I=0啊;到最后i=8;