StrToIntDef converts a String into an Integer data type.
If the String does not contain a Integer value it will default to the value as supplied as the def parameter.
Declaration: Function StrToIntDef( const S : string; def: Longint) : Integer;
The example is.