Ktype; The Character String ) - Mitsubishi QD51 Programming Manual

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

Advertisement

11 INSTRUCTIONS AND FUNCTIONS

KTYPE

Function
• Returns the character type of the specified position within the character string that includes
full-byte characters.
KTYPE ( <character string expression> , <numeric expression> )
Syntax
character string expression
numeric expression
A=KTYPE(A$,4)
Examples
• The KTYPE function returns the character type of the character corresponding to the
Description
number of characters specified by <numeric expression> in <character string expression>
counting from the left as follows. Full-byte characters are counted as one character.
0
• • • •
1
• • • •
• If the value of <numeric expression> is 0 or greater than the number of characters in the
character string, an "Illegal function call" error will be generated. This error will also be
generated when the <character string expression> is " " (empty character expression).
Program Example
10 ' Checks the character type
20 A$="@@@@@@@"
30 A=KTYPE(A$,6)
50 PRINT "Character type is";A
60 END
RUN
Character type is 1
OK
11 - 118
Kanji TYPE
• • • •
• • • •
A$
AB @ @ @ @
1 2 3
4
Half-byte characters (numbers, alphabets, Kana characters, etc.)
Full-byte characters (Kanji, etc.)
REMARK
See the KINSTR, KLEN and KMID$ functions.
Specify the applicable character string for the
process
Specify the character position within the character
string in which the type is verified.
Counts the characters from the left of A$ and
assigns the character type of the fourth character to
A.
Full-byte character
:
' Defines the character string
:
' Character type of the 6th character from
the left
MELSEC-Q
A
1
11 - 118

Advertisement

Table of Contents
loading

This manual is also suitable for:

Ad51h-s3Qd51-r24A1sd51s

Table of Contents