Omron SYSMAC C200H-ASC02 Operation Manual page 68

Ascii unit
Hide thumbs Also See for SYSMAC C200H-ASC02:
Table of Contents

Advertisement

BASIC Language
LEN Function
MID$ Function
OCT$ Function
RIGHT$ Function
58
Format:
LEFT$(<x$>,<i>)
<x$> is the string to be searched.
<i> is the number of characters to be returned.
Example:
A$ = LEFT$(B$,5)
Remarks:
<i> must be an integer from 0 to 255. If <i> is 0, an empty string is returned
as the function value. If <i> is greater than the number of characters in <x$>,
the entire character string is returned.
Purpose:
To return the number of characters in a character string
Format:
LEN(<x$>)
Example:
A = LEN(A$)
Remarks:
A value of 0 is returned if the "character expression" is an empty
string.
Purpose:
To return the requested part of a given string
Format:
MID$(<x$>,<i>[,<j>])
<x$> is the given string.
<i> is the position of the first character to be returned.
<j> is the number of characters to be returned.
Example: B$ = MID$(A$,2,5)
Remarks:
<i> must be from 1 to 255.
<j> must be from 0 to 255.
If <j> is 0, or if the value of the specified character position (<i>) is greater
than the number of characters in the character expression (x$), an empty
string is returned.
If <j> is omitted, or if <j> exceeds the number of characters to the right of the
specified position (<i>) in the character expression, all the characters to the
right are returned.
Purpose:
To convert the specified decimal number into an octal character
string
Format:
OCT$(<x>)
<x> is a numeric expression in the range of -32768 to 32767.
Example:
A$ = OCT$(B)
Remarks:
If the value of <x> includes a decimal point, the INT function is internally ex-
ecuted to round it off.
Purpose:
To return the specified number of characters from the rightmost
character of the character string
Section 4-2

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents