Hi everyone.

Let's say you have the following where edit1.maxLength is set to 2.

Code:
if (edit1.Text = '21') and (block.Image = formGame.DXImageList.Items.Find('Block1')) then
begin
  pause;
  result := True;
  player.Moved := true;
end;
if (edit1.Text = '6') and (block.Image = formGame.DXImageList.Items.Find('Block2')) then
begin
  pause;
  result := True;
  player.Moved := true;
end;
Now if the user enters 21 into the edit it works and if the user enters 6 into the edit it also works. But what if the user enters 61 into the edit? It still works because the 6 is recognized but not the 1 after the 6. Let's say the condition is 3x2=6 then 61 will also be accepted, which is false. The maxLength is 2 so the user will allways be able to enter 2 digits into the edit.

I also tried setting the maxLength at the edit.change and edit.exit but it doesn't work. Any ideas?