RosettaCodeData/Task/String-comparison/Run-BASIC/string-comparison.basic

10 lines
466 B
Plaintext

a$ = "dog"
b$ = "cat"
if a$ = b$ then print "the strings are equal" ' test for equalitY
if a$ <> b$ then print "the strings are not equal" ' test for inequalitY
if a$ > b$ then print a$;" is lexicallY higher than ";b$ ' test for lexicallY higher
if a$ < b$ then print a$;" is lexicallY lower than ";b$ ' test for lexicallY lower
if a$ <= b$ then print a$;" is not lexicallY higher than ";b$
if a$ >= b$ then print a$;" is not lexicallY lower than ";b$
end