Focal Point
[CLOSED] Converting HexCode

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/8347043296

January 14, 2020, 08:35 AM
MSGWoods
[CLOSED] Converting HexCode
Good morning. I am not a programmer but I use webfocus to design and created basic reports. One of the issues that I am having is that I need to convert data from hex to decimal. In excel, I can convert back and from using hex2dec or dec2hex. What I have, for example, is 4D01A443 (hex) that I need to convert to 1291953219 (dec) so that I can join two tables to create a report. The "userid" in one table is the hex code but in the 'user' table the "userid" is a dec code.

Any suggestions?

Thanks,

Scott

This message has been edited. Last edited by: FP Mod Chuck,
January 14, 2020, 10:01 AM
BabakNYC
https://infocenter.information...source%2Ftopic13.htm

Probably need UFMT function.


WebFOCUS 8206, Unix, Windows
January 14, 2020, 01:44 PM
Waz
What version of WebFOCUS are you on ?

There are new functions being added in new releases.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

January 14, 2020, 02:00 PM
MSGWoods
WebFocus Enterprise Edition
Product Release: 8.2
Service Pack: 0.1
Build/GEN Number: 164
Build/GEN Date: May 5, 2017

thanks,
January 14, 2020, 03:35 PM
Waz
You should put that in your signature, under Go / Personal Zone / Profile / View/Edit Complete Profile

Then add it to "(**required) Product Signature: Please fill out your WebFOCUS release, OS/Platform, and expected Output format(s), AND also the fields below:"

You can use HTML in it.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

January 14, 2020, 04:15 PM
Waz
I'm beginning to this that there are two ways to do this.

1. Write something, say a DEFINE FUNCTION that converts each char of the string to a number, then multiplying them out to get the integer. I think I've done that before, a long time ago.

2. If you are calling a relational DB, you could use DB_EXPR to call a native DB function like CONVERT or CAST


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

January 17, 2020, 05:18 AM
Tony A
quote:
Any suggestions?

Yes, shoot or re-educate the designers of your tables! This should never be designed this way!

Seriously though, There are some good suggestions here. Also consider doing a search on the forum for "HEX TO DEC" as this question has been asked (and answered) before, so you may find other suggestins in previous answers.

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10