Both items are strings. They're not equal. It seems Universe is doing some kind of conversion on them that makes them equal.
If I convert the strings to integers it knows they're not equal. If I concatenate a letter on to either string it knows they're not equal.
My client was using smaller numbers in a field but a new specification requires and 18 digit number. They don't want to to through all there programs that compare these numbers and modify them with a alpha character or int conversion.
Does anyone know what's going on and how to best fix it?
Henry,
I think you have it on the nail there. I was musing about another BASIC compiler option (see below) but unfortunately it does not take affect for comparison operations. I think it's definitely worth asking for an expansion as an enhancement as "long math"-related issues have arisen more and more over recent years, whether or not the string value was intended to be a number or if it was just happenstance.
- $OPTIONS STRING.MATH Causes UniVerse BASIC to automatically use the SADD, SSUB, SDIV, and SMUL functions rather than +, -, /, and *. This option also applies to the INT, ABS, NEG, and MOD functions.
As a suggestion if only to make the inline code for comparisons more intuitive (someone may just think those INT() fiunctions are redundant in the future), create an user conversion exit (ICONV/OCONV) function called (for example) $STRCMP that accepts two arguments and does the necessary to check they are string equal, regardless of content. This could be by the addition of a non-numeric character or a forced INT() as appropriate just to evaluate whether the two values are or are not string equal. Equally this could be a local function, though a global function is available without specific coding of $INCLUDE/$INSERT.
Regards
JJ