Thank You Richard,

I thought I would have to perform some sort of conversion to go from a
integer to a bit field.  Apparently it all happens automatically.

Thanks for the tip.

Mark Douglas


"Richard Burmeister" <[EMAIL PROTECTED]> wrote in message
news:48124@palm-dev-forum...
>
> > From: Mark Douglas
> >
> > Has anyone taken an ASCII date in a format like mm/dd/yy and
> > stuffed it into a DateType. I am curious how you populate
> > the DateType structure. The declaration of the structure
> > looks foreign to me. It looks like it should be
> > 6 Bytes but is really only 2.
> >
>
> This is how bitfields are defined in C, so your question is really a C
> question, not a Palm question.
>
> given the 16 bits (= 2 bytes) of a DateType defined as
>
> typedef struct {
> UInt16 year  :7;  // years since 1904 (MAC format)
> UInt16 month :4;
> UInt16 day   :5;
> } DateType;
>
> Then you fill a DateType variable with values like this:
>
> DateType today;
>
> today.year = 97;
> today.month = 4;
> today.day = 3;
>
> If this is not enough info to clarify what's happening then you should get
a
> book on C programming.
>
>
>



-- 
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