以下是仅仅判断是否为integer类型,其他类型你只要加入型如strToInt(str)的函数即可
function MyIsNumeric(const Str:String):boolean;
begin
try
strToInt(str);
except
result:=False;
exit;
end;
result:=true;
end;
function MyIsNumeric(const Str:String):boolean;
begin
try
strToInt(str);
except
result:=False;
exit;
end;
result:=true;
end;
strtofloat('?????.????)
except
showmessage('error');
end;
Number:=StrToFloat(Str);
showmessage('是数字串');
except
showmessage('不是数字串');
end;