× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



There is a strong possibility I am over complicating this so before I spend
too much time on this I wanted to ask...

I am trying to write a generic procedure to retrieve a data area that is a
decimal value. Currently, we have to adjust the procedure every time we
need to handle a new size, and then we have to add variables and specific
code for that size.

I am trying to use the QWCRDTAA to retrieve the value and ultimately want
return a decimal of 30p 9 that contains what ever was found in the data
area. Problem is, the data comes back as hex from QWCRDTAA (the raw
decimal data). Obviously I could just MOVE the data if I wanted to define
decimals of all possible sizes, but then I am back to the very thing I am
trying to avoid.

As a part of my procedure, I pass in the definition of the data area, so I
know that at run time. What is the quickest way to get that raw/hex data
into a decimal variable I can work with? If you were to put the logic I am
looking for into a procedure, the prototype to convert this character/hex
data would need to look something like this:

D HexToPacked pi 30p 9
D pHex 2000a
D pDecLen 5i 0
D pDecPrecision 5i 0

Just remember, the character data here does not contain '20.345'. If it
did, it would be easy. The data here is in hex and I need to get it to
packed. Essentially I am want to moving data into a packed field where
size is not known at compile time. As I said, I am probably over
complicating this.

Thanks.

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.