F_BA_FillStr

F_BA_FillStr 1:

The F_BA_FillStr function extends a string to a minimum length by padding it with a filler character. Depending on the mode, text is inserted on the left or appended on the right.

Syntax

FUNCTION F_BA_FillStr : BOOL
VAR_INPUT
  sSrcString : POINTER TO STRING;
  nSrcSize   : UINT;
  nMinLength : UINT;
  nPadding   : BYTE;
  eMode      : (eInsert:=1, eAppend:=2)SINT := 1;
END_VAR

F_BA_FillStr 2: Inputs

Name

Type

Description

sSrcString

POINTER TO STRING

String to be padded.

nSrcSize

UINT

Size of the destination buffer.

nMinLength

UINT

Desired minimum length.

nPadding

BYTE

Filler character as a byte value.

eMode

SINT

eInsert inserts on the left; eAppend appends on the right.