Deletion Of Character String From Specified Position - Mitsubishi Electric MELSEC Q Series Programming Manual

Structured text
Hide thumbs Also See for MELSEC Q Series:
Table of Contents

Advertisement

6 IEC FUNCTIONS

6.10.7 Deletion of character string from specified position

n characters of character string is deleted from the specified position and later of the specified character string.
Function definition
Function definition
6 - 75
STRING DELETE( STRING S1, INT n, INT POS );
Argument
Argument Name
IN/OUT
S1
IN
n
IN
POS
IN
Return value
Return Value
STRING
Deletion result (character string data)
Remarks: This function cannot be used with the Basic model QCPU.
Secure the area of the number of characters after deletion + 1 character as
the data area that will store the character string data after deletion.
If the deletion position POS is 0, n characters of character string will be
deleted, starting at the end (right) of the data to be deleted S1.
Example of use
Argument Type
STRING
w_Str2 := DELETE(
w_Str1,w_Word1, w_Word2 );
BOOL DELETE_E( BOOL EN, STRING S1, INT n, INT POS, STRING D1 );
Argument
Argument Name
IN/OUT
EN
IN
S1
IN
n
IN
POS
IN
D1
OUT
Remarks: Secure the area of the number of characters after deletion + 1 character as
the data area that will store the character string data after deletion.
Return value
Return Value
BOOL
Execution condition
Example of use
(*
When execution condition X0 turns ON, the character string of the number of
(*
characters specified in iData1 is deleted, starting at iData2 from the head of
(*
the character string data in sData, and the result is stored into Result.)
M0 := DELETE_E( X0, sData, iData1, iData2, Result ) ;
DELETE
DELETE_E
Data to be deleted (character string data)
Number of characters to be deleted (BIN 16-bit data)
Deletion position (BIN 16-bit data)
ST Program
Conversion Result
LD
LEN
-
RIGHT
-
AND<>
MOV
MIDW
Execution condition (Function is executed only when the result is TRUE)
Data to be deleted (character string data)
Number of characters to be deleted (BIN 16-bit data)
Deletion position (BIN 16-bit data)
Deletion result (character string data)
Description
Description
Used Instruction
SM400
LD,LEN,-,RIGHT,
w_Str1
AND<>,MOV,MIDW
D10238
w_Word1
D10238
w_Str1
w_Str2
D10238
w_Word2 K1
D10239
10239 K0
K1 D10238
w_Str1
w_Str2
D10238
Description
Description
*)
*)
*)
6 - 75

Advertisement

Table of Contents
loading

This manual is also suitable for:

Melsec l series

Table of Contents