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