tempstr:string;tempstr:='123456789';if (Char(LeftStr(tempstr,1)) in ['0'..'9']) then
    ......
为何通不过,请问应该怎样做?退而求其次,如何判断tempstr的第一个字节为数字!

解决方案 »

  1.   

    if (LeftStr(tempstr,1) in ['0'..'9']) then
      

  2.   

    if (tempstr[1] in ['0'..'9']) then
      

  3.   

    对了,还有
    这里的tempstr:='123456789'只是一个特例,也有可能是
          tempstr:='';
          tempstr:='你好';
      

  4.   

    可以了,开始测试时自已弄错了!
    谢谢zjqyb,谢谢大家的参于!结贴!
      

  5.   

    var
      tempstr:string;
    begin
      tempstr:='';
      if tempstr<>'' then
      begin
        if (tempstr[1] in ['0'..'9']) then
          showmessage('11');
      end;
    end;