如题

解决方案 »

  1.   

    var
      a:float;
    begin
      try
        a:=StrToFloat(StringGrid[1,1]);
      except
        showmessage('不是Float型');
      end;
      showmessage('是Float型');
    end;
      

  2.   

    var 
      b : Variant ;
    begin
      case VarType(b) of
        varCurrency : ShowMessage('Float');
        varEmpty    : ShowMessage('Empty');
      end;
      

  3.   

    遍历整个STRINGGRID,判断是否可以转换成FLOAT型
      for i:=1 to stringgrid.rowcount do
        for j:=1 to stringgrid.colcont do
           begin
           try 
           strtofloat(stringgrid.cell[i-1,j-1]);
           except
           showmessage(inttostr(i-1)+'行'+inttostr(j-1)+'列不是浮点数');
           end 
           end;