Peter Piper <No*****@Email.com> wrote in news:cmvjl7$jpc$1
@sparta.btinternet.com:
A Quick question if someone could help, im sure this has been asked
before, but googling is getting me now where slowly.
Is it possible to get an unsigned 32 bit integer field in Access.
Im storing IP address in their integer form (ie. 32 bits) and Long
Integer because it is signed can not represent the full range needed
(0..4294967295), neither can Double.
Any suggestions please?
Cheers PeteP.
PS. 32 bit unsigned integer = Caridnal = DWORD = unsigned LongInt.
posted preiously:
As we know decimals can be effected in VBA through their assignment (as a
string seems to be more efficient for long ones then as a number) with the
CDec operator.
They are stored in the 16 bytes of the variant as
byte(0) -> 14 ... the type, ie decimal
byte(1) -> 0 ... seemingly unused
byte(3) -> the number of decimal places
byte(4) -> 0 (positive) or 128 (negative)
bytes(5 - 15) a 48 bit unsigned integer ( ... not the 16 bit integer we
know and love??)
While the help file calls these signed integers they do not seem to be
signed integers in the way a long is a signed integer, that is where the
last (or first depending upon your view point) bit is set to indicate
negativity, while the other bits of that byte hold values. In fact the 48
bits are signed by the preceding byte and are in my opinion, basically
unsigned, as we use signed.
That is 2^32 -1 as a decimal (variant) is 4294967295 while the same bytes
as a long are -1 ... (not to be confused with 2^32-1 as an expression which
is stored as a double.)
Why do I mention this?
Sometimes in programming we want an unsigned integer. I think positive
decimals with zero places of decimals could give us such and I think VBA is
hiding a 48 bit mathematical capability which might prove useful in ... I'm
sure there MUST be something!
--
Lyle
--
use iso date format: yyyy-mm-dd
http://www.w3.org/QA/Tips/iso-date
--
The e-mail address isn't, but you could use it to find one.