Apache OpenOffice (AOO) Bugzilla – Issue 74928
Recommendation for better explanation of string comparison in BASIC
Last modified: 2017-05-20 11:31:22 UTC
I was quite surprised to find that OO BASIC string comparison is different than in many other contexts (although it may be consistent with other BASIC implementations). For example, "a" > "b" as well as "a" > "ab" etc. In other words, string x "is greater than" string y iff x precedes y lexicographically. In many other situations the definition is exactly the reverse: x > y iff y precedes x. Note that the latter definition is a natural generalization of the ordering of natural numbers: Number n > m if n appears later in the enumeration of natural numbers. Since strings may be enumerated similarly to natural numbers, it would make sense to define for two strings x > y as "x appears later than y in the lexicographic enumeration of strings". Obviously, I am not saying that the implementation should be changed; but in view of the foregoing, I think that string comparison merits an explanation in the on line and other documentation. Looking at the online documention, an appropriate place for a small comment would be Macros and Programming -> Command Reference -> Run-Time Functions, Statements, and Operators -> Comparison Operators
@ab: can you comment, please?
Seems to be a bug, especially as VB behaves differently. Should be fixed at lest for compatibilty mode. I'm not sure if we should document an obviously wrong behaviour. STARTED, OOo 2.x
-> 3.x
Reset assigne to the default "issues@openoffice.apache.org".