You have defined that you want the recID to be unsigned so the minus sign
(any negative number) is nonsensical, and if the compiler is so configured,
will generate warnings. The interpretation will be 0xFFFFFFFF or 4294967295
(which is the 2's complement representation of -1 for a 32-bit number).
The code might work, but the interpretation is not what you expect and could
cause further errors. Your code is equivalent to:
UInt32 recID = 4294967295;
if (recID == 4294967295 ) {
...
This snippet, however is mathematically correct and will not generate errors
or warnings. But it is probably not what you want either...
Dominique
"David Eyler" <[EMAIL PROTECTED]> wrote in message
news:94901@palm-dev-forum...
>
> I've been using negative one to represent a special value with unique IDs,
> which are UInt32's. Does anyone know if it is 100% reliable to count on
the
> code below to work right?
>
> UInt32 recID = -1;
> if (recID == -1) {
> //should be in here
> }
>
> I know when I look in the debugger and I set a unsigned Int to -1 it shows
> up as one less than its maximum value, not -1. Thanks.
>
>
>
>
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/support/forums/