Today's gem is brought to you by not understanding "not":

Today's gem is brought to you by not understanding "not":

procedure TSystemSetups.edNoNumbers(Sender: TObject; var Key: Char);
begin
if (Key in ['A'..'Z','a'..'z']) then
Key := #0;
end;

Comments

  1. Lars Fosdal The only problem with your change is that it disables the delete key (learnt that from experience). From memory, I have used something like:

    if not (key in ['0'..'9', #0..#31]) then key := 0;

    ReplyDelete
  2. Well, we all made a not error, it seems :)

    ReplyDelete
  3. Mathematicians are distributed among three classes: those who mastered counting to three and those who did not yet.

    ReplyDelete

Post a Comment