>Pass the UID by &-ing with 0x00FFFFFF and you
>will get a sensible error code back.

Hmm, I wouldn't advise this.  I'd say that if you've got anything in the
high byte, then you're dealing with garbage/invalid data, and that you're
going to have random results if you pass it to any API routine.  And that
you really need to find where in your code you're pulling garbage data
from!  (Assuming it isn't a -1 value meaning no such record, but in that
case you should check that before calling the routine.)

(You might as well say "just pass the low 8 bits and you'll get a sensible
error return".  Well, yes, but only if you're lucky enough that there isn't
a valid record that happens to match, except if there isn't a valid record
with that ID it might fail in some other bad way...)

The idea behind this fatal alert, and fatal alerts in general, is that they
shouldn't be in release roms unless they indicate that the application is
dealing with bad data and has a good probability of crashing in a second
anyway, or corrupting data, etc.

In other words, that there's a serious logic flaw in the application, that
isn't just something that robust software should be able to deal with like
"database not found" would be.

-David Fedor
Palm Developer Support



-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/tech/support/forums/

Reply via email to