AT&T 6300 Programmer's Manual page 83

Gwbasic by microsoft
Hide thumbs Also See for 6300:
Table of Contents

Advertisement

Variable Types
Strings may be compared using the same
relational operators that are used with
numbers:
=
< >
< >
<= =<
>= =>
String comparisons are made by taking one
character at a time from each string and
comparing the ASCII codes. If all the ASCII
codes are the same, the strings are equal. If
the ASCII codes differ, the lower code number
precedes the higher. If during string
comparison the end of one string is reached,
the shorter string is said to be smaller.
Leading and trailing blanks are significant.
Example
"AA"
<
"AB"
"FILENAME"
=
"FILENAME"
"X&"
>
"X#"
"CL"
>
"CL"
"kg" > "KG"
"SMYTH"
<
"SMYTHE"
BS< "9/12/78"
where BS
=
"8/12/78"
Thus, string comparisons can be used to test
string values or to alphabetize strings. All
string constants used in comparison
expressions must be enclosed in quotation
marks.
Note that lower case letters have higher ASCII
codes than upper case letters.
3-25

Advertisement

Table of Contents
loading

Table of Contents