Smiley:
With your example, I now see how the msgbox function (probably) decodes the values given, something I have wondered about for some time.
Absolutely yet again :)
Smiley:
I do not understand the part about true being all bits=1.... Any chance of more explanation on that?
A pleasure.
For simplicity, we'll start by reducing our integer value to 4 bits  just to make the numbers smaller and easier to follow. We're dealing with signed values, so a 4bit variable can handle from 0 (0h in Hex) to 15 (Fh) in unsigned or from 8 (8h) to 7 (7h) as signed. Let's just take a closer look at the signed interpretations of all the possible values, as this is how we typically refer to them :
 Signed Hex Binary Boolean

8 8h 1000 True

7 9h 1001 True

6 Ah 1010 True

5 Bh 1011 True

4 Ch 1100 True

3 Dh 1101 True

2 Eh 1110 True

1 Fh 1111 True

0 0h 0000 False

1 1h 0001 True

2 2h 0010 True

3 3h 0011 True

4 4h 0100 True

5 5h 0101 True

6 6h 0110 True

7 7h 0111 True
While each value that isn't exactly zero triggers the True path in an
If statement or
IIf() function, only the value 1 is equal to the predefined value
True (Hence these two entries only are highlighted).
If you haven't dealt with storage of negative numbers before then the reason they are stored as they are, to represent the numbers as they are (Instead of a single bit used as a pos/neg flag followed by the Absolute value of the number in the remaining bits for instance), is that binary arithmetic in computer processors work in such a way as to flow from negative to positive this way without any special handling. Consider these same binary values but treat them as unsigned. Let's now look at incrementing (A simple addition of one) 6, which is 10 (Ah) when viewed as unsigned. You would expect 10 to increment to 11 (Bh) yes? What do we notice as the signed verion of 11? 5. Let's now look at some values that overflow. To do this it may help to consider an extra bit (BinarydigIT) to the left of the four we have. This is usually handled as an
Overflow flag in the processor, but it is sensible for us to understand it as an extra bit. We just ignore this bit once it's comleted the process.
 0  1 ==> 1 0000  0 0001 ==> 16  1 ==> 10h  1h = Fh ==> 15 ==> 0 1111 (or 1111) ==> 1

1 + 1 ==> 0 1111 + 0 0001 ==> 15 + 1 ==> Fh + 1h = 10h ==> 16 ==> 1 0000 (or 0000) ==> 0
Does that all make sense? And does it answer your question adequately?