Hex to int
IT
it at plastipol.com
Thu Dec 22 15:03:42 UTC 2022
Hi,
Thank you all for your assistance.
Finally I have something like this
Calculate lvHex as 'FF' ## lvHex is Local var Character 8
Calculate lvInt as bintoint32(binfromhex(jst(lvHex;'-8P0'))) ## lvInt is Local var Integer 32 bit
Regards
xavier
> El 21 dic 2022, a las 21:02, Rudolf Bargholz <rudolf at bargholz.ch> escribió:
>
> Hi Xavier,
>
> FF = FF0000000
>
> You need to use 000000FF
>
> Oh, I see Alan already answered this.
>
> Regards
>
> Rudolf
>
> -----Ursprüngliche Nachricht-----
> Von: omnisdev-en <omnisdev-en-bounces at lists.omnis-dev.com> Im Auftrag von IT
> Gesendet: Mittwoch, 21. Dezember 2022 16:23
> An: OmnisDev List - English <omnisdev-en at lists.omnis-dev.com>
> Betreff: Re: Hex to int
>
> Hi Rudolf,
>
> I’m unable to get this done. Hexadecimal FF is decimal 255
>
> Calculate lvHex as 'FF' ## lvHex is Local var Character 100000000
> Calculate lvBin as binfromhex(lvHex) ## lvBin is Local var Binary
> Calculate lvInt as bintoint32(lvBin) ## lvInt is Local var Integer 32 bit
>
> lvInt result is -16777216
>
> Any advice?
>
> Xavier
>
>> El 21 dic 2022, a las 10:32, Rudolf Bargholz <rudolf at bargholz.ch> escribió:
>>
>> Hi Xavier,
>>
>> Perhaps binfromhex() and then bintolong() from the binary functions?
>>
>> Regards
>>
>> Rudolf
>>
>> -----Ursprüngliche Nachricht-----
>> Von: omnisdev-en <omnisdev-en-bounces at lists.omnis-dev.com> Im Auftrag
>> von IT
>> Gesendet: Mittwoch, 21. Dezember 2022 10:10
>> An: OmnisDev List - English <omnisdev-en at lists.omnis-dev.com>
>> Betreff: Hex to int
>>
>> Hi,
>>
>> I’m unable to find an omnis function to convert hex number in decimal number.
>>
>> Any clue how to do easily in Omnis?
>>
>> regards
>>
>> xavier
>> _____________________________________________________________
>> Manage your list subscriptions at https://lists.omnis-dev.com Start a
>> new message -> mailto:omnisdev-en at lists.omnis-dev.com
>> _____________________________________________________________
>> Manage your list subscriptions at https://lists.omnis-dev.com Start a
>> new message -> mailto:omnisdev-en at lists.omnis-dev.com
>
> _____________________________________________________________
> Manage your list subscriptions at https://lists.omnis-dev.com Start a new message -> mailto:omnisdev-en at lists.omnis-dev.com
> _____________________________________________________________
> Manage your list subscriptions at https://lists.omnis-dev.com
> Start a new message -> mailto:omnisdev-en at lists.omnis-dev.com
More information about the omnisdev-en
mailing list