F_BA_HasPrefix2L

The function F_BA_HasPrefix2L checks whether a string begins with a certain prefix.
The string to be examined and the prefix to be compared are each defined by address pointers in the input variable area.
The length of the string and prefix to be examined can be specified using the input variables nString and nPrefix. If these variables have 0 entries, the length is determined internally.
If the length of the prefix is greater than the string length, the string cannot contain the prefix.
Syntax
FUNCTION F_BA_HasPrefix2L : BOOL
VAR_INPUT
sString : POINTER TO STRING;
nString : UDINT := 0;
sPrefix : POINTER TO STRING;
nPrefix : UDINT := 0;
END_VAR
Inputs
Name | Type | Description |
|---|---|---|
sString | POINTER TO STRING | An address pointer to the string to be examined. |
nString | UDINT | Length of the string to be analyzed. |
sPrefix | POINTER TO STRING | Address pointer to the prefix to be compared. |
nPrefix | UDINT | Length of the prefix to be compared. |