REPLACE2

REPLACE2 1:

The function replaces nLen characters of a string with another string, starting at position nPos.

The function returns

The function stops the checking of the input length after Parameterlist.cMaxCharacters characters in order to avoid an infinite loop.

FUNCTION REPLACE2 : BOOL

REPLACE2 2: Inputs

VAR_INPUT
    pSrcString    : POINTER TO STRING;
    pInsertString : POINTER TO STRING;
    pDstString    : POINTER TO STRING;
    nDstSize      : UDINT;
    nLen          : UDINT;
    nPos          : UDINT;
END_VAR

Name

Type

Description

pSrcString

POINTER TO STRING

Pointer to the STRING variable whose string is to be searched (input string).

pInsertString

POINTER TO STRING

Pointer to the STRING variable whose string is to replace the characters (input string).

pDstString

POINTER TO STRING

Pointer to the resulting STRING variable (output string)

nDstSize

UDINT

Size of the resulting STRING variable (output string) in bytes. The operator SIZEOF() can be used for the assignment.

nLen

UDINT

Number of characters to be replaced.

nPos

UDINT

Position of the character to be removed including the following characters (nPos = 1 = first character).

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.35.0