> From: Clement Chan
>
> Suppose I have defined two structures (typedef
> struct{....}).  Can I save both of them in the same
> database?
>

> From: DeAnna Davidson
>
> yes.
>

To expand on that a bit...

You are free to put whatever you want in each record of your database (up to
about 64 KB).  If you put in two different structures, you will want to have
some way to identify the contents so you can later read the data.  One way
to do this is to use the first member of the structure to identify which
data is in the record.  For example (warning - uncompiled code just typed
into this email!):

enum types
{
  typeA = 0,
  typeB
};
typedef struct
{
  enum types thisType;
  union data
  {
    struct A
    {
      Char name[20];
      UInt age;
      // etc;
    } A;
    struct B
    {
      UInt height;
      UInt weight;
      // etc;
    } B;
  } data;
} recordType;


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