Einzelnen Beitrag anzeigen

drama22

Registriert seit: 12. Jan 2013
88 Beiträge
 
#3

AW: Delphi flood text Protection

  Alt 4. Nov 2014, 23:33
What result do you expect from IsFlood and please show the line in code where you set this expected result.
i didnt figure the result part i need help with it i was thinking to do somthing like that with is flood

Delphi-Quellcode:
  function IsFlood:Boolean;
  var
  i, x : integer;
  begin
    Result := False;
    i := trunc(GetTickCount/2);
    x := trunc((i - LastFloodTime)/4);
    Result := False;
if x < //detect flood// then Result := True;
    LastFloodTime := i;
but dont know how to detect the flood i use also in main form private declarations

Delphi-Quellcode:
    FloodpSay : integer;
    FloodClose : Integer;
but i cant figure what to do to detect the fast typing and thats what iam doing with the timer

Delphi-Quellcode:
procedure Tmain.msgTmrTimer(Sender: TObject);
begin
  msgTmr.Enabled := False;
  FloodpSay := FloodpSay + 1;
  if FloodpSay > FloodClose then
    begin
      pnlFlood.Visible := False;
      FloodpSay := 0;
    end;
  if FloodpSay <> 0 then
    msgTmr.Enabled := True;
end;
  Mit Zitat antworten Zitat