11 - 103 11 - 103
MELSEC-Q
11 INSTRUCTIONS AND FUNCTIONS
Program Example
10 ' Extracts only half-byte characters or full-byte characters from the character string
20 A$="AD51H@"
30 B$=KEXT$(A$, 0)
:
' Extracts only half-byte characters
40 C$=KEXT$(A$, 1)
:
' Extracts only full-byte characters
50 PRINT "Original character string-->";A$
60 PRINT "Half-byte characters------>";B$
70 PRINT "Full-byte characters------>";C$
80 END
RUN
Original character string-->AD51H@@
Half-byte characters------>AD51H@
Full-byte characters------>@
OK
REMARK
See the KMID$ function and Section 3.13.