I know someone is probably going to tell me I'm a little slow, but here's my
problem.  I have a structure that is really a UInt16 with definitions for
different bits.  When debugging, I look at the structure and the values are
fine.  However, whenever I try to use a value from the structure, (ie
compare it to another number, write it out to the screen), all it gives me
is zero.  What am I missing?

Here is the structure definition:

typedef struct {
        UInt16 pwdProtected:1; // 1 = protected
        UInt16 favorite:1;     // 1 = added to favorites list
        UInt16 difficulty:3;
        UInt16 copyable:1;
        UInt16 reserved:10;
} leafFlagsType;

Then, I use that struct inside another:

typedef struct {
        UInt16 type;
        UInt16 ID;
        leafFlagsType leaf;
} RecStructType;

I have a variable defined as RecStructType rec

Then I try to check the value of difficulty. The debugger says that
rec.leaf.difficulty = 3 and diffValue = 0 *after* the statement below is
run.  Even if I try and do a compare in line (1 < rec.leaf.difficulty < 5)
it still fails.

        diffValue = rec.leaf.difficulty;

Any ideas?

DeAnna


-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palm.com/devzone/mailinglists.html

Reply via email to