function StrToIntDef(S: String; Def: LongInt): LongInt;
The StrToIntDef function converts the string passed in S into a number. If S does not represent a valid number, StrToIntDef returns the number passed in Def.