Len ( Returns The Number Of Characters Of A Character String ) - Mitsubishi QD51 Programming Manual

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

Advertisement

11 INSTRUCTIONS AND FUNCTIONS
LEN
Function
• Returns the number of characters of a character string.
LEN ( <character string expression> )
Syntax
character string expression
A=LEN(A$)
Examples
• The LEN function counts and returns the number of characters of the character string
Description
specified by the character string expression.
• The control characters 00h through 1Fh in the character code and spaces are counted.
• The LEN function counts full-byte characters as two half-byte characters. See the KLEN
function is counting full-byte characters as one character.
Example
Program Example
10 ' Checks the number of characters in the character string
20 A$="@@AD51H-BASIC"
40 PRINT "Number of characters-->";LEN(A$)
50 END
RUN
Number of characters--> 15
OK
11 - 121
LENgth
• • • •
• • • •
LEN Function
A B C D
@
@
1 2 3 4 5 6 7 8
KLEN Function
A B C D
@
@
1 2 3 4
5
6
REMARK
See the KLEN function and Section 3.13.2.
Specify the character string for which the number of
characters will be counted.
Stores the number of characters in character
variable A$ in A.
A$
A B C D E F
A 6
8
6
:
' Defines the character string
MELSEC-Q
11 - 121

Advertisement

Table of Contents
loading

This manual is also suitable for:

Ad51h-s3Qd51-r24A1sd51s

Table of Contents