This is pretty easy to fix. You can use this or similar code: if Key in ['0'..'9'] = false then begin key := #0; showmessage('invalid value') end; Your specific case can be handled like this: if ((key = 'o') or (key = 'O')) then key := '0'; Put this code in the KeyPress event of the edit box. Good luck and have fun!
Joe Wilcox "Reading Cliff Notes to know a novel is like eating Count Chocula to know steak" "Nine women cannot have a baby in one month" [EMAIL PROTECTED] ----- Original Message ---- From: Arsen Khachatryan <[EMAIL PROTECTED]> To: delphi-en@yahoogroups.com Sent: Monday, July 31, 2006 9:18:22 AM Subject: [delphi-en] The Calculation HI ALL FRIENDS, I HAVE A EDIT BOXES FOR CALCULATE NUMBERS.FOR EXAMPLE 7:2 AND ETC. SOMETIMES THE SECOND VALUE WILL BE 0 AND WHEN THE USER PUTS A 0 FOR EXAMPLE 8+0 GIVES A ERROR THAT 0 IS NOT A INTEGER OR NUMBER.ANY EXAMPLE FOR CALCULATION THAT CAN DO WITHOUT ERROR.FOR EXAMPLE IF THE SECOND VALUE IS 0 CAN CALCULATE NORMAL AS 8+0=8?? THANKS A LOT FOR THE EXPERTS THAT THEY ARE HELPING THE BEGGINERS LIKE ME. ------------ --------- --------- --- Do you Yahoo!? Get on board. You're invited to try the new Yahoo! Mail Beta. [Non-text portions of this message have been removed] [Non-text portions of this message have been removed] ----------------------------------------------------- Home page: http://groups.yahoo.com/group/delphi-en/ To unsubscribe: [EMAIL PROTECTED] Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/delphi-en/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/