Einzelnen Beitrag anzeigen

Dash
(Gast)

n/a Beiträge
 
#1

Zahl erst hochzählen wenn andere Hunderter erreicht hat

  Alt 11. Feb 2005, 20:25
Hi,

ich habe vor eine Zahl +1 zu zählen, wenn eine andere einen vollen Hunderter erreicht hat.
z.B. bei 100 soll die zweite auf 1 sein bei 200 auf 2 usw.

Ich habe das ganze bisher so realisiert:
Delphi-Quellcode:
procedure TMainForm.Timer1Timer(Sender: TObject);
begin
 if (x < Mouse.CursorPos.X) or (x > Mouse.CursorPos.X) or
    (y < Mouse.CursorPos.Y) or (y > Mouse.CursorPos.Y) then
 begin
  cm := StrToInt(IntToStr(cm + 1));
  if cm > 100 then
  m := StrToInt(IntToStr(m + 1));
  Label4.Caption := inttostr(ord(cm));
  Label5.Caption := inttostr(ord(m));
 end;
 x := Mouse.CursorPos.X;
 y := Mouse.CursorPos.Y;
end;
Aber so bald cm über 100 ist werden die M die ganze Zeit mitgezählt :/

MfG
  Mit Zitat antworten Zitat