MD OCONV on alpha strings (OpenInsight 32-bit Specific)
At 17 MAY 2002 03:17:57PM David Kafka wrote:
I don't know if this is an old or new OI issue.
In ARev, OCONV("pounds","MD24,")=pounds" no matter where I try it.
In OI, I am not sure what it equals. For example, in a POPUP with a defined MD24, conversion on a column that is mixed numbers and some text, the word "pounds" comes out ",pou,nds.(0"
In Rlist, if I define a symbolic called TEST in a table called TEMP, and TEST is defined as @ANS=pounds" with an MD24, output conversion, and I do RUN RLIST 'LIST TEMP TEST',1 I get a column of "1000,000,000.00" (when the column has a display length of 14).
Same symbolic, if I remove the output conversion and say
@ANS=OCONV("pounds","MD24,") and do the RLIST, I now get a column of "100.00"
If I run this procedure:
SUBROUTINE TEST (NULL)
X=pounds"
Y=OCONV(X,"MD24,")
Z=ICONV(Y,"MD4")
CALL MSG(X:"|":Y:"|":Z)
RETURN
The message box says "pounds/100.00/1000000"
This doesn't seem right to me. Is this expected/desired behavior?
Thanks,
David
At 17 MAY 2002 06:53PM Richard Hunt wrote:
David,
The standard for ICONV and OCONV conversions is for it to fail during that type of conversion. The STATUS() variable should return a "1", and the result of the conversions should return "POUNDS".
So, the statement "RESULT=OCONV("POUNDS","MD24") should result as…
STATUS() equaling 1, and RESULT equaling "POUNDS".
Thank you for enlightening me on that. I do verify using the ICONV and the ICONV does work properly as far as the STATUS() variable. I have noticed that OpenInsight is quite unique when it comes to handling numbers as string variables. It seems that OpenInsight does not care if the string variable is numeric or not when it tries to convert it to a number.
Also, I think that you might have problems with precision with greater than 4 decimal places.
At 17 MAY 2002 08:40PM David Kafka wrote:
Richard,
In these situations, it's not STATUS() I'm worried about, but RESULT.
I think OCONV is broken, but I don't know if this is a 32-bit problem or an OI problem.
David
At 17 MAY 2002 09:00PM Richard Hunt wrote:
I agree with you David. It should fail and return the original value, rather than trying to convert the non-numeric number.