DELETE (FUN)ΒΆ
FUNCTION DELETE : STRING(255)
Deletes a number of characters from a string
DELETE (STR, LEN, POS) means: Delete LEN characters from STR, beginning with the character in the POS position.
POS = 0 or POS = 1, are both addressing the first character.
Bemerkung
The current implementation is unfortunately not correct for the case
Pos=0. The implementation cannot be changed for compatibility reasons.If
Pos=0 is used, the parameter LEN is internally reduced by one!It is generally recommended to use values in the range specified by IEC 61131-3. The smallest value for
Pos is specified there as 1.(* Example declaration *)
VarSTRING1 : STRING ;
(* Example in ST , result is 'SUSI' *)
VarSTRING1 := DELETE ('SUXYSI',2,3);
- InOut:
Scope
Name
Type
Comment
Return
DELETESTRING(255)String remaining after deletion
Input
STRSTRING(255)String to be modfied
LENINTLength of the partial string to be deleted, number of characters
POSINTPosition in
STRafter which the deletion starts. Counted from left, starting with 1