F_StringIsASCII
The function checks whether a string contains only ASCII characters (0x000 to 0x7F) and returns the number of ASCII characters. The string is directly compatible to UTF-8 if it contains only ASCII characters.
The function stops the checking of the input length after Parameterlist.cMaxCharacters
characters in order to avoid an infinite loop.
FUNCTION F_StringIsASCII : BOOL
The return value is TRUE if the string contains only ASCII characters.
VAR_INPUT
VAR_INPUT
pSTRING : POINTER TO STRING;
END_VAR
pString: pointer to the STRING variable.
VAR_OUTPUT
VAR_OUTPUT
nLen : UDINT;
END_VAR
nLen: Number of ASCII characters in the string
Requirements
Development environment | Target platform | PLC libraries to be integrated (category group) |
---|---|---|
TwinCAT v3.1.4022 | PC or CX (x86, x64, ARM) | Tc2_Utilities (System) >= 3.3.21.0 |