Question
· Feb 23, 2023

Issue with Logical Operators on Strings

Hi all,

I might be losing my mind or do not understand how ObjectScript does string comparisons, but the following does not look right to me.

Is it really possible that you can't compare non-numerical strings other than with an equals or not equals?

USER>w ("45" < "46")
1
USER>w ("45" > "46")
0
USER>w ("V45" < "V46")
0
USER>w ("V45" > "V46")
0
USER>w ("V45" <= "V46")
1
USER>w ("V45" >= "V46")
1

In Python:

>>> print("45" < "46")
True
>>> print("45" > "46")
False
>>> print("V45" < "V46")
True
>>> print("V45" > "V46")
False
>>> print("V45" <= "V46")
True
>>> print("V45" >= "V46")
False
Product version: Ensemble 2018.1
Discussion (4)1
Log in or sign up to continue