请问Delphi中判断数字的函数是哪个?也就是区分字母和数字的哪个函数!请问他是包含在哪个单元里的?
还有就是我经常见别人用TDataTimePicker控件,为什么找不到,是不是自创的控件,请教!

解决方案 »

  1.   

    var
      str: string;
      lp: integer;
    begin 
      str := '12kdk';
      for lp := 1 to length(str) do
      if str[lp] in ['0'..'9'] then
        showmessage('数字')
      else
        showmessage('非数字') 
    end;
      

  2.   

    判断一个字符是否是数字用
    (ord(c) >=ord('0'))and (ord(c)<=ord('9'))TDataTimePicker控件在win32页
      

  3.   

    我见过这个函数好象叫做IsNumeric(),是不是这个,请指教!!!
      

  4.   

    procedure Val(S; var V; var Code: Integer);
    if Code <> 0 then 不是数字。
      

  5.   

    function  Isdigital(const s:string):boolean;
    var i:integer;xsd:integer;
    begin
      result:=true;
      xsd:=0;
      for I := 1 to Length(S) do
      begin
        case s[i] of
          ['0'..'9']:;
          ['.']:inc(xsd);
        else
          begin
            result:=false;
            break; 
          end;
      end;
      result:=result and (xsd<=1); 
    end;
    function  IsInt(const s:string):boolean;
    var i:integer;
    begin
      result:=true;
      for I := 1 to Length(S) do
      begin
        case s[i] of
          ['0'..'9']:;
        else
          begin
            result:=false;
            break; 
          end;
      end;
    end;
      

  6.   

    倒!!!用不了这么长吧,自己写一个啊。如果返回为true则为数字,否则不为数字
    function IsNumeric(tmp_str: string): Boolean;
    var
      i: double;
    begin
      Result := True;
      try
        i := StrToFloat(Tmp_Str);
      except
        Result := False;
      end;
    end;
    //嘻嘻!简单吧
      

  7.   

    datetimepicker控件在Win32标签的第10个项目(自左向右)!-_-!
      

  8.   

    http://expert.csdn.net/Expert/topic/2199/2199312.xml?temp=.7149622100%可以解决你的问题。
      

  9.   

    不如在onkeypress里面这样设置if (((Key>='0') && (Key<='9')) || (Key=='.') || (Key=='\b'))
           {
           return;
           } else{
                 Key='\b';
                 ShowMessage("请输入数字");
           }
    以上是c做的,变成pascal的这样:
    if (key>='0') and (key<='9') then ...
    就可以了
    '.' 代表小数点,
    '\b'代表空格
      

  10.   

    直接用try 
             strtoint(...)
           except 
               showmessage(...)
           end;
      就可以
      

  11.   

    用APIIsCharAlphaNumeric(ch: Char);   //确定字符是否是数字