try
  StrToInt(edit1.Text);
  Result := True;
except
  Result := False;
end;

解决方案 »

  1.   

    f:=true;
    s:=edit1.text;
    for i:1= to length(s) do
      if not(s[i] in ['0'..'9']) then
        f:=false;if not f then
      showmessage('error');
      

  2.   

    function IsNumeric(c: char): Boolean;
    so
    if IsNumeric(PChar(Edit.Text)) then
      

  3.   

    try
      StrToFloat(Edit1.Text);
      //是数字
    except
      //非数字
    end;
      

  4.   

    uses IdGlobal;
    if IsNumeric(PChar(Edit.Text)) then
    ...
      

  5.   

    StrToIntDef(const S: string; Default: Integer): Integer;
      

  6.   

    IsNumeric是对单个字符的,Sorry