📌  相关文章
📜  如何验证编辑中的文本是否有数字并在delphi代码示例中显示一条消息

📅  最后修改于: 2022-03-11 14:54:56.247000             🧑  作者: Mango

代码示例1
// 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;