RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
AnsiString::ToIntDef Method

Converts the string to an integer, returning a default value if the string is invalid.

Pascal
function ToIntDef(defaultValue: Integer): Integer;
C++
__fastcall int ToIntDef(int defaultValue) const;

System::AnsiString::ToIntDef converts the given string to an integer value and returns the integer. If the string doesn't contain a valid value, the value given by defaultValue is returned. 

 

Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!