1个回答
展开全部
没有这个函数.不过你可以自己写函数
Function isInteger(s: string): boolean;
Begin
result := CoventDataType(s,'Integer');
End;
Function isFloat(s: string): boolean;
Begin
result := CoventDataType(s,'Float');
End;
function isDate(s: string): boolean;
begin
result := CoventDataType(s,'Date');
End;
function isTime(s: string): boolean;
Begin
result := CoventDataType(s,'Time')
End;
function isDatetime(s: string): boolean;
Begin
result := CoventDataType(s,'A-DateTime'); //A 代表 DateTime 区别于DateTime
End;
Function CoventDataType(S: string; sType: string) : boolean;
Begin
result := false;
try
case Ord(sType[1]) of
65,97 : strtoDateTime(s);//A- dAtetime类型
68,100: StrToDate(S); //D- 'Date' 的ASC码
70,102: StrToFloat(S); //F- Float
73,105: StrToInt(S); //I- integer
84,116: StrToTime(S); //T- Time
else
exit;
end;
Result := true;
except
on E: EConvertError do result := false;
End;
End;
Function isInteger(s: string): boolean;
Begin
result := CoventDataType(s,'Integer');
End;
Function isFloat(s: string): boolean;
Begin
result := CoventDataType(s,'Float');
End;
function isDate(s: string): boolean;
begin
result := CoventDataType(s,'Date');
End;
function isTime(s: string): boolean;
Begin
result := CoventDataType(s,'Time')
End;
function isDatetime(s: string): boolean;
Begin
result := CoventDataType(s,'A-DateTime'); //A 代表 DateTime 区别于DateTime
End;
Function CoventDataType(S: string; sType: string) : boolean;
Begin
result := false;
try
case Ord(sType[1]) of
65,97 : strtoDateTime(s);//A- dAtetime类型
68,100: StrToDate(S); //D- 'Date' 的ASC码
70,102: StrToFloat(S); //F- Float
73,105: StrToInt(S); //I- integer
84,116: StrToTime(S); //T- Time
else
exit;
end;
Result := true;
except
on E: EConvertError do result := false;
End;
End;
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询