how to check if something is only numbers in delphi
if TryStrToInt(Edit1.Text, Value) then
DoSomethingWithTheNumber(Value)
else
HandleNotANumberError(Edit1.Text);
how to check if something is only numbers in delphi
if TryStrToInt(Edit1.Text, Value) then
DoSomethingWithTheNumber(Value)
else
HandleNotANumberError(Edit1.Text);
how to validate if the text in edit has numbers in and to show a message if it has in delphi
// Taking OP question obsessively literally, this
// function doesn't allow negative sign, decimals, or anything
// but digits
function IsValidEntry(s:String):Boolean;
var
n:Integer;
begin
result := true;
for n := 1 to Length(s) do begin
if (s[n] < '0') or (s[n] > '9') then
begin
result := false;
exit;
end;
end;
end;
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us