I think I'll leave all the resource db questions to
be answered by someone who knows the answers, but this
one I think I can tackle...

> -----Original Message-----
> From: Michael S. Davis [mailto:[EMAIL PROTECTED]]
...
> Do all records of any database, have a type associated with them, or
> do only resources records have a type?

And the answer is: there is a type if you put one there.

Dig: Each database has a 4-byte type tag associated with 
it in addition to the 4-byte creator type tag.  If you
are making a database it is up to you what goes into it.

For example I can make an application that puts competitions
competitors and their scores into separate databases:

        Creator/Type            Contents
        Skor/Wher                       database of competitions
        Skor/Who-                       database of competitors
        Skor/What                       database of score by Who- @ What

struct CompetitionRec {
        int id;
        ??? date;                       /* long? this is off the top of my
head... */
        char name[41];
}

struct CompetitorRec {
        int id;
        char name[41];
}

struct ScoreRec {
        int CompetitonId;
        int CompetitorId;
        int Score;
}

Each database is uniquely identified, and contains homogenous
data.  I have a record type defined in my programs for each
database.  Therefore you -could- say that each database record
has a type associated with it, if only by implication (if it 
is a record in Skor/Wher, the it MUST be a struct CompetitionRec).

Another way to go is to use heterogenous data.  Put all of your
records in a single database.  But now how do you tell what record
is what?  Well, you add a type field to the struct.

        Creator/Type            Contents
        Skor/Data                       db, record types "Wher" "Who-" &
"What"

struct CompetitionRec {
        char recType[4];
        int id;
        ??? date;
        char name[41];
}

struct CompetitorRec {
        char recType[4];
        int id;
        char name[41];
}

struct ScoreRec {
        char recType[4];
        int CompetitonId;
        int CompetitorId;
        int Score;
}


Now we're down to the wire.  We have two system databases:

        psys/sprf               Saved Preferences
        psys/pref               Unsaved Preferences

Well, someone at Palm defined the structure of these
database types.  (Each -could- be different, but my guess
is that they are the same despite the different type tags)

Presumably since resource databases store heterogenous
data the record structure defined for them includes additional
"type" fields identifying which type of data has been
stored in that record.

So ... to finally answer your question:  yes, each record
in every database has a type ... but it is not necessarily
stored in the record itself (in the case of databases with
homegenous data).

-- 
-Richard M. Hartman
[EMAIL PROTECTED]

186,000 mi./sec ... not just a good idea, it's the LAW!

Reply via email to