Character String Functions - Omron SYSMAC C200H-ASC02 Operation Manual

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

Advertisement

BASIC Language
4-2-6

Character String Functions

ASC Function
CHR$ Function
HEX$ Function
INSTR Function
LEFT$ Function
<x> is an expression in radian units.
Example:
A = TAN(3.141592/2)
Purpose:
To return the ASCII character code of the first character of the
given string
Format:
ASC(<x$>)
Example:
A = ASC(A$)
Remarks:
An empty string cannot be specified. The CHR$ function performs the in-
verse operation.
Purpose:
To return a character corresponding to the specified character
code
Format:
CHR$(<i>)
Example:
A$ = CHR$(&H41)
Remarks:
<i> must be from 0 to 255. If <i> is a real number, it will be rounded off and
converted into an integer. The ASC function performs the inverse operation.
Purpose:
To return a string which represents the hexadecimal value of the
decimal argument
Format:
HEX$(<x>)
Example:
A$ = HEX$(52)
Remarks:
If the value of the decimal number includes a decimal point, the INT function
is internally executed to round it off to an integer.
Purpose:
To return the position of the first occurrence of string <y$> within
string <$x>
Format:
INSTR([<i>,]<x$>,<y$>)
<i> is the position from where the search starts. <i> must be be-
tween one and 255.
<x$> is the string to be searched.
<y$> is the desired string.
Example:
A = INSTR(5,B$,"BASIC")
Remarks:
If <i> is omitted, the search begins with the first character in <x$>. If the data
cannot be found, 0 is returned as the function value. If <y$> is an empty
string, INSTR returns <i> or 1.
Purpose:
To return the specified number of characters beginning from the
leftmost character of the character string
Section 4-2
57

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents