11 - 108 11 - 108
MELSEC-Q
11 INSTRUCTIONS AND FUNCTIONS
KINSTR
Function
Kanji INSTRing
• 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
expression 2> )
arithmetic expression
• • • •
Specify the location to start searching the character
string.
character string expression 1
• • • •
Specify the target character string.
Syntax
character string expression 2
• • • •
Specify the character string to be searched.
J=KINSTR(3, A$, “NAGOYA”)
• • • •
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.
Examples
A$
A$
@460@@@@@@@@@5- 14
@100@
@
@@@@
@@@@2 2- 3
-
1 2 3 4 5 6 7 8
Search range
J
5
J
0
• The KINSTR function searches <character string expression 2> in <character string
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."
Description
• If <character string expression 2> is an empty character string, the KINSTR function will
return the same value as <numeric expression>.
Содержание A1SD51S
Страница 183: ...11 13 11 13 MELSEC Q 11 INSTRUCTIONS AND FUNCTIONS RUN Before swap A 0 H924 A 1 H1159 After swap A 0 H1159 A 1 H924 OK...
Страница 331: ...11 161 11 161 MELSEC Q 11 INSTRUCTIONS AND FUNCTIONS REMARK See the CON ON OFF STOP and ZOPEN functions and Section 7 4...
Страница 557: ...11 387 11 387 MELSEC Q 11 INSTRUCTIONS AND FUNCTIONS REMARK See the CHR SPACE and SPC functions...
Страница 629: ...11 459 11 459 MELSEC Q 11 INSTRUCTIONS AND FUNCTIONS REMARK See the ZOPEN ZSEND and ZCNTL instructions and Section 7 3 4...
Страница 645: ...11 475 11 475 MELSEC Q 11 INSTRUCTIONS AND FUNCTIONS REMARK See the ZEVENT ZSIGNAL and DEF ZEVENT instructions...