Hi Del, sure you can include structures in structures. AFAIK, it's not a PalmOS thing, but rather a C thing. As an example, here's a quick sample from one of my apps, where I declare a couple of structs, then include them in another struct. Note that the large structure contains my own structures plus the "TimeType" structure as declared by the PalmOS headers. Bob

FWIW.  Bob

typedef struct {
   Boolean        on:1;
   Boolean        override:1;
   Boolean        overrideV:1;
   Boolean        vibrate:1;
   Boolean        unused:4;
   UInt8        soundType;
   UInt16        vol;
   UInt16        pause;
   UInt16        speed;
   UInt16        hz;
   UInt16        stime;
   char        *name;
} SoundDataType;

typedef struct {
   Boolean        on:1;
   Boolean        hrly:1;
   Boolean        unused:6;
   UInt8        days:7;
   UInt8        unused2:1;
} ChimeFlagsType;

typedef struct {
   UInt16        type;
   ChimeFlagsType    flags;
   TimeType    start;
   TimeType    end;
   SoundDataType    data[5];
} ChimeType;


Hi,

I am using Metrowerks Codewarrior.

1.  Can I create a structure containing other structures that will describe a 
large group of engines AND a large group of transmissions?  In other words.  I 
want to describe both the engines and the transmissions with critical 
identifiers for inventory.  Any chance someone might show me how to code this 
for PalmOS?  I was thinking I might start with:

Struct TransEng[200]
{

struct motor
{
unsigned hp, displacement, liter;
char[20] manufacturer;
bool works;
}

struct transmission
{
char[20] manufacturer, model;
}

} myinventory;

(Pardon all errors, PLEASE.)

2.  Once I create "myinventory", how do I save it? Is it "already saved" once 
it is created because I am working directly on the memory it occupies under PalmOS?

Thank you for any responses that serve to make this learning curve less steep 
than it feels like at present.


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

Reply via email to