F_StringIsASCII

F_StringIsASCII 1:

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.

F_StringIsASCII 2: Inputs

VAR_INPUT
    pSTRING : POINTER TO STRING;
END_VAR

Name

Type

Description

pString

POINTER TO STRING

Pointer to the STRING variable

F_StringIsASCII 3: Outputs

VAR_OUTPUT
    nLen : UDINT;
END_VAR

Name

Type

Description

nLen

UDINT

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