×
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.
HI David
You probably already know the way to do this with a loop and an array.
In any case, here's a general description for the archives.
Have an array or table sorted, maybe, on the hex characters, 0-F. The
2nd value would be the decimal value of each character. You could also
have it all in a subprocedure, with a big select-when - but I think
that'd perform less well, although not too important for small hex values.
Start with the right-most nybble of the nex value. Use a zero-based
loop, add each hex digit times the power of the index to the total,
you'll have your value when done.
There must be a dozen or more - heh - examples out there with the details.
Regards
Vern
On 9/9/2019 7:47 AM, David Gibbs via RPG400-L wrote:
Folks:
Does anyone have a routine handy (or know of an API) that will convert
hex characters to decimal or integer?
For example: If I have the character value 'BC614E' I would get
12345678 returned.
I had hoped there would be something in SQL, since there is a HEX
function that will convert a numeric into character hex, but it
doesn't appear to exist.
Thanks!
david
As an Amazon Associate we earn from qualifying purchases.
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.