Character String Operations; Character String Connection; Character String Comparison - Omron SCARA YRCX Series Programming Manual

Robot controller
Hide thumbs Also See for SCARA YRCX Series:
Table of Contents

Advertisement

2

Character string operations

1
2.1
2
3
4
5
2.2
6
4-4
Chapter 4 Expressions and Operations

Character string connection

Character strings may be combined by using the "+" sign.
SAMPLE
A$="OMRON"
B$="ROBOT"
C$="LANGUAGE"
D$="MOUNTER"
E$=A$+" "+B$+" "+C$
F$=A$+" "+D$
PRINT E$
PRINT F$
Results:
OMRON ROBOT LANGUAGE
OMRON MOUNTER

Character string comparison

Characters can be compared with the same relational operators as used for numeric values.
Character string comparison can be used to find out the contents of character strings, or to sort
character strings into alphabetical order.
In the case of character strings, the comparison is performed from the beginning of each string,
character by character.
If all characters match in both strings, they are considered to be equal.
Even if only one character in the string differs from its corresponding character in the other string,
then the string with the larger (higher) character code is treated as the larger string.
When the character string lengths differ, the longer of the character strings is judged to be the
greater value string.
All examples below are "true".
Examples: "AA"<"AB"
"X&">"X#"
"DESK"<"DESKS"

Advertisement

Table of Contents
loading

Table of Contents