Converting to HEX
Archiver
Posts: 46,084
I have a 3-digit variable called AD0 - 729, 778, 810, etc.
I want to convert the first 2 digits of AD0 to HEX and store it in AD0a.
If AD0 = 729 then AD0a = $72
I want to do the same thing with digit 3 and store it in AD0b
if AD0 = 729 then AD0b = $9
Any suggestions? Remember I'm working with a variable woth unknown digits.
Sid
[noparse][[/noparse]Non-text portions of this message have been removed]
I want to convert the first 2 digits of AD0 to HEX and store it in AD0a.
If AD0 = 729 then AD0a = $72
I want to do the same thing with digit 3 and store it in AD0b
if AD0 = 729 then AD0b = $9
Any suggestions? Remember I'm working with a variable woth unknown digits.
Sid
[noparse][[/noparse]Non-text portions of this message have been removed]
Comments
klaus0@x... writes:
> Can't you split your variable into 'HIGHNIB' and 'LOWNIB' and then do your
> conversion on that ?
>
> maybe, if I know how to convert a decimal number to the same thing in hex.
Not the equivalent, but the same thing. In other words I want to convert 72 to
$72, not to $48, which is the equivalent of decimal 72.
Sid
[noparse][[/noparse]Non-text portions of this message have been removed]
Can't you split your variable into 'HIGHNIB' and 'LOWNIB' and then do your
conversion on that ?
Regards,
Klaus
Original Message
From: <Newzed@a...>
To: <basicstamps@yahoogroups.com>
Sent: Saturday, July 17, 2004 1:36 AM
Subject: [noparse][[/noparse]basicstamps] Converting to HEX
> I have a 3-digit variable called AD0 - 729, 778, 810, etc.
>
> I want to convert the first 2 digits of AD0 to HEX and store it in AD0a.
>
> If AD0 = 729 then AD0a = $72
>
> I want to do the same thing with digit 3 and store it in AD0b
>
> if AD0 = 729 then AD0b = $9
>
> Any suggestions? Remember I'm working with a variable woth unknown
digits.
>
> Sid
>
>
> [noparse][[/noparse]Non-text portions of this message have been removed]
>
>
>
> To UNSUBSCRIBE, just send mail to:
> basicstamps-unsubscribe@yahoogroups.com
> from the same email address that you subscribed. Text in the Subject and
Body of the message will be ignored.
>
> Yahoo! Groups Links
>
>
>
>
>
>
>