strToSint (Function)

Top  Previous  Next

Architecture:

X32 / NX32 / NX32L

Device support:

ALL

Firmware version:

1.00 / 1.00.00


strToSint will convert a string to a number (SINT). If the conversion is not possible, strToSint will return 0.

 

Input:

str : STRING

String to convert.

 

Returns: SINT

The value of the string.

 

Declaration:

FUNCTION strToSint : SINT;
VAR_INPUT
  str : STRING;
END_VAR;

 

Example:

INCLUDE rtcu.inc
 
VAR
  result : SINT;
END_VAR;
 
PROGRAM test;
 
BEGIN
  ...
 result := strToSint(str:="47");
  // result will contain 47 after the call
  ...
END;
 
END_PROGRAM;