StrToIntDef tries to convert the string, and gives you back a default value if it can't convert. For example, to convert, and get back -1 if a problem occurs:
[pascal]MyInt := StrToIntDef(YourString, -1);[/pascal]
Alternatively, use exception handling:
[pascal]try
MyInt := StrToInt(YourString);
except
// a problem occurred - deal with it
MyInt := -1;
end;[/pascal]
Bookmarks