一个变量不是定义好了么。还判断它是否为整型干什么么?
变量可能是别处传入,用来检查其合法性
//是否整型
function IsInt(AStr: string): Boolean;
var
Value, Code: Integer;
begin
Val(AStr, Value, Code);
Result := Code = 0;
end;
function IsInt(S: string): boolean;
var
Int: Int64;
begin
Result := true;
try
Int := StrToInt64(s);
except
Result := false;
end;
end
[此贴子已经被作者于2005-7-31 1:36:26编辑过]
VB, Delphi, ASP, PHP, JSP, .NET
MS SQL, My SQL, Oracle
Diablo, StarCraft, WarCraft, World of Warcraft