WARNING: I am a C & Palm OS newbie...

Joe,

Thanks for the post.  I started with your suggestion and ended with:

typedef struct typeListItems
 {
 Int16    Count;
 Boolean   Expanded;
 Int8    Index;
 Int8    Level;
 Char*    Name;
 struct typeListItems* Next;
 struct typeListItems* Child;
 struct typeListItems* Parent;
 } typeListItem;

typeListItem mobjListItemSet[100];

Where I have a flat array containing individual 'ListItem' nodes and each
node is responsible for 'pointing' to its parent, next sibling, and first
child.    This works great in my initial testing but I am left with the
following questions...

1)  Would this still cause problems with the 'Stack space' limit you refer
to in your post?

2)  In my initial testing I simply selected a fixed array size.  Any
suggestions on a scheme that would allow for 'variable size arrays'? In VB
world I would probably use a collection or could use an array and then
'resize' it if I exceeded initial declaration.

3) 'Stringer' replied to my post and suggested that I store this in a
database since a database is an 'indexed linked list'.  Since I will want to
store the information anyway this sounds like a good suggestion (presuming I
can get databases to work).  My question is, how do the memory manager and
database manager compare in terms of data retrieval speeds?

Thanks for reading and responding to my posts.

Lance

p.s.  I am using Metroworks CW8 demo if it has any impact on anything...




"Joe" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED].;
>
> --- Lance wrote:
> > I am a newbie at PalmOS and C so please bear with me...
>
> OK
>
> > I would like to have similar functionality in my Palm version and
> > thought of using a declaration such as...
> >
> > typedef struct
> > {
> > Char* Title;
> > Char* Text;
> > TreeNode TreeNodes[10];
> > }TreeNode;
> >
>
> You can't do that in C.  However, you can do something like this:
>
> typedef struct
> {
>   Char* Title;
>   Char* Text;
>   struct TreeNode *TreeNodes;
> } TreeNode;
>
> TreeNode *treeNodeP;
>
> (See pg 131 of the version 1 of "The C Programming language to for
> explanation.)
>
> WARNING: Stack space on all current Palm OS devices is extremely small,
> so recursion is almost always a bad idea.  Especially if you were
> serious when you said "Theoretically, the tree would support an
> infinite number of 'generations' of children nodes."
>
>
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Sports - sign up for Fantasy Baseball
> http://sports.yahoo.com
>
>



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