Titan



str2int


This function converts a charstring representing an integer value to the equivalent integer. If the string does not represent a valid integer value (e.g. it's an empty string, there're some non-numerical/non-sign characters in the string etc.) the function gives a compile error for string constants or a dynamic testcase error when the string cannot be evaluated at compile time.


Related keyword:


str2int(charstring value) return integer


Example 1:

const integer c_siffra := str2int("-66");

The constant called c_siffra will have the integer value -66.

Example 2:

const integer c_seffre := str2int("abc");

Compile error.