Character String And Displays The First Location In Which It Is Found - Mitsubishi QD51 Programming Manual

Logic controller
Hide thumbs Also See for QD51:
Table of Contents

Advertisement

11 INSTRUCTIONS AND FUNCTIONS
KINSTR
Function
• Searches through a character string containing full-byte characters for the specified

character string and displays the first location in which it is found.

KINSTR ([ <arithmetic expression > ,] <character string expression 1>, < character string
Syntax
expression 2> )
arithmetic expression
character string expression 1
character string expression 2
J=KINSTR(3, A$, "NAGOYA")
Examples
• The KINSTR function searches <character string expression 2> in <character string
Description
expression 1>, then returns the location of the first match if found or returns 0 if not found.
• The KINSTR function processes full-byte characters (Kanji) as one character.
• <Numeric expression> specifies the search starting position. If omitted, the search will be
performed from the beginning of <character string expression 1>. If the value is greater
than <character expression 1>, the KINSTR function will return "0."
• If <character string expression 2> is an empty character string, the KINSTR function will
return the same value as <numeric expression>.
11 - 108
Kanji INSTRing
• • • •
Specify the location to start searching the character
string.
• • • •
Specify the target character string.
• • • •
Specify the character string to be searched.
• • • •
Searches the character string "NAGOYA" from the
third character of A$, and assigns the location if
found or assigns 0 if not found to J.
Search range
A$
@460@@@@@@@@@5- 14
1 2 3 4 5 6 7 8
A$
@100@
@@@@
@
@@@@2 2- 3
J
5
-
J
0
MELSEC-Q
11 - 108

Advertisement

Table of Contents
loading

This manual is also suitable for:

Ad51h-s3Qd51-r24A1sd51s

Table of Contents