Utilities.StrToIntDef Method

Applies to TestComplete 15.10, last modified on December 01, 2021
This method is obsolete. See the Remarks section below.


The Utilities.StrToIntDef method converts the string Str, which represents an integer-type number in either decimal or hexadecimal notation, into a number. If the source string does not represent a valid number, StrToIntDef returns the value specified by the Default parameter.


Utilities.StrToIntDef(Str, Default)

Str [in]    Required    String    
Default [in]    Required    Integer    
Result Integer

Applies To

The method is applied to the following object:


The method has the following parameters:


Specifies the string to be converted into a number.


Specifies the value to be returned by the method if the Str string does not represent a valid number.

Result Value

The integer value to which the specified string has been converted or the Default value.


The StrToIntDef routine correctly recognizes hexadecimal numbers if they are prefixed with $ or 0x. To recognize a hexadecimal number with &H prefix that is adopted in VBScript, you should replace the prefix with $ or 0x.

This method is obsolete. It is supported for backward compatibility only. To convert a string to an integer number, use the aqConvert.StrToInt method.

See Also

StrToInt Method
IntToStr Method
Format Method
StrToFloat Method
StrToCurrency Method

Highlight search results