try
  StrToInt()
except
 ...不过我一般是
if (StrToIntDef(s, MaxInt) = MaxInt) then
 ...