strToDint (Function)

Top  Previous  Next

Architecture:

X32 / NX32 / NX32L

Device support:

ALL

Firmware version:

1.00 / 1.00.00


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

 

Input:

str : STRING

String to convert.

 

Returns: DINT

The value of the string.

 

Declaration:

FUNCTION strToDint : DINT;
VAR_INPUT
  str : STRING;
END_VAR;

 

Example:

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