Utilities.StrToIntDef Method

Applies to TestComplete 15.42, last modified on September 08, 2022
This method is obsolete. See the Remarks section below.

Description

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.

Declaration

Utilities.StrToIntDef(Str, Default)

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

Applies To

The method is applied to the following object:

Parameters

The method has the following parameters:

Str

Specifies the string to be converted into a number.

Default

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.

Remarks

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