× 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.



I did not try it, but I think if you define a DS whit an integer and a char overlapped you will get it translated by moving an hex value to the char and using the integer or vice versa.

On 9/9/19 10:19 AM, Vernon Hamberg wrote:
you got it, my friend! I should have stayed with that API, as I've used it and the reverse several times.

Cheers
Vern

On 9/9/2019 8:59 AM, David Gibbs via RPG400-L wrote:
On Mon, Sep 9, 2019 at 7:47 AM David Gibbs <david@xxxxxxxxxxxx> wrote:
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 think I solved my own problem.

There is an api to do what I want ... I just misunderstood what it does.

cvtch will convert hex to a number. I was under the impression that it
only converted hex numbers (F0-F9) into a numeric field. Turns out it
will convert any hex into it's binary equivalent.

**free

ctl-opt dftactgrp(*no);

dcl-pr cvtch extproc('cvtch');
   dest pointer value;
   src pointer value;
   len int(10) value;
end-pr;

dcl-s hexValue char (8) inz('00BC614E');
dcl-s binValue int (10);
dcl-s len int(10);

len = %len(hexValue);

cvtch(%addr(binValue):%addr(hexValue):len);

*inlr = *on;







-- Este e-mail fue enviado desde el Mail Server del diario ABC Color -- -- Verificado por Anti-Virus Corporativo Symantec --

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

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.