Function ValidInt (AText:String) : Integer; Begin try Result:=0; StrToInt(AText); except on E:EConvertError do Result:=-1; end; end;