Re: changing the decimal to hex

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



If the user is storing the Hex numbers with the &H prefix then my solution
would be

IIF(IsNumeric([TheField]),"&H" & Hex(CLng([TheField])),Null)

That changes the number to its base 10 equivalent and then changes that to
its hex equivalent. But if the number is not being stored with the prefix,
there is no way to handle the ambiguity inherent with 9836.

--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
..

"Jamie Collins" <jamiecollins@xxxxxxxxxx> wrote in message
news:1191583087.270716.121480@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
On Oct 4, 5:59 pm, John W. Vinson <jvinson@xxxxxxxxxxxxxxxxxxxxxxxxxx>
wrote:
If your field contains the string "1FA3" then it's clearly hex... but
what if
it contains "9836"? Is that decimal 9836 ('x266C') or is it hex 9836
(38966),
and how on Earth can you tell?

Didn't you just answer your own question there? i.e. formatting
(&H0000266C&, &H266C&, etc).

I think the question is, why isn't the OP storing values using a
numeric type?

Jamie.

--




.



Relevant Pages

  • Re: linux-next: kbuild tree build failure
    ... the CONFIG_ prefix, which is often ignored when scanning) contains ... config variable on PPC64 as the PPC32 address split reason is moot. ... hex "PINT3_ASSIGN" ... the number of digits input? ...
    (Linux-Kernel)
  • Re: LUA coders: how to limit Editboxes to a number range
    ... Many color tables on the web give values in hex ... I'd suggest accepting either a "0x" prefix (for C ... programmers) or a "h" suffix (for assembler programmers). ... a "#" prefix for web coders. ...
    (alt.games.warcraft)
  • Re: duplicate ops (Re: updated assembler)
    ... I didn't mean HEX in my question which was about: ... are required to come after the REX, since they are part of the opcode (and ... any other prefix is required to come prior to REX. ... a fast first match finding by hash and contiunue with details there ...
    (alt.lang.asm)
  • Re: binary number
    ... that let you define binary constants like B8 ... > prefix is plain '0'), which is a bit easier to cope with than hexadecimal ... I always found octal harder than hex. ... than bundles of 3 bits. ...
    (comp.lang.cpp)
  • Re: [RFC, patch] i386: vgetcpu(), take 2
    ... storing the address of pda there). ... You mean in the kernel? ... %gs prefix is a lot faster than this. ...
    (Linux-Kernel)