StrToIntDef

Top  Previous  Next

Prototype

 

IntOutput:= StrToIntDef(strInput, intDef)

 

Description

 

It converts a string to an integer and if the number cannot be converted the output is default value.

 

Parameters

 

StrInput: string to be converted in an integer number.

 

IntDef: integer default value in which convert the string if the conversion is not possible.

 

Returned value

 

IntOutput: integer number obtained from the conversion.

 

Notes

 

None.

 

Example

 

//It inizializes a string variable

name:='tony';

 

//It writes the conversion value in a output variable

output:=StrToIntDef(name,0);