Replace text REPLACE

Swaps Count characters at Position for B.

TagAfter two scans
Msg'FILL OFF'
MsgOut'FILL ON '
NewState'ON '
StateLen3
StatePos6

How it's used

Use REPLACE to change part of a message.

TagValue
Msg'FILL OFF'
NewState'ON '
MsgOut'FILL ON '

MsgOut reads FILL ON.

Operands

OperandData typeRead or write
ASTRING or a numberReads
BSTRING or a numberReads
CountDINT or a numberReads
PositionDINT or a numberReads
DestSTRINGWrites

Common mistakes

  • Assuming replacement always fitsCheck both the selected source range and the capacity needed for the result.