Delphi Pages Forums  

Go Back   Delphi Pages Forums > Delphi Forum > General

Lost Password?

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 02-25-2019, 04:24 AM
SvenLittkowski SvenLittkowski is offline
Member
 
Join Date: Jul 2010
Posts: 39
Default HELP: My CHAR does not like to work

Hi, all I want is to ensure that no other input can be entered into an EDIT field than numeric values. I added an OnKeyPress procedure, where I check for the ORD value of the pressed keyboard button.

My thought was, if the input is not numeric, to replace the value of the pressed keyboard button witha nothing. But it seems, theere is some thinking error, and I get the following message:
Incompatible types: char and string


And here is the source code that gives me that famous error.
Quote:
procedure TAlpha.EditBalloonVolumeKeyPress(Sender: TObject; var Key: Char);
begin
if not(ord(Key)in[48..57]) then Key:='';
end;
Reply With Quote
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT. The time now is 02:16 AM.


Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2019, vBulletin Solutions, Inc.