strLen (Function)

Top  Previous  Next

Architecture:

X32 / NX32 / NX32L

Device support:

ALL

Firmware version:

1.00 / 1.00.00


strLen will return the length (number of characters) of a string.

 

Input:

str : STRING

String that is to be extracted from.

 

Returns: INT

The number of characters in the str string.

 

Declaration:

FUNCTION strLen : INT;
VAR_INPUT
  str : STRING;
END_VAR;

 

Example:

INCLUDE rtcu.inc
 
VAR
  result : INT;
END_VAR;
 
PROGRAM test;
 
BEGIN
  ...
 result := strLen(str:="hello world");
  // result will contain 11 after the call
  ...
END;
 
END_PROGRAM;