>CharPtr name;
>....
>name = (CharPtr)MemPtrNew(StrLen{in_name));
>StrCpy(name, in_name);
>
>Any ideas why that doesn't work?

you're not allocating enough memory.  remember that strings are
null-terminated, so use "StrLen(in_name) + 1".


>I have also changed the array declaration from :
>
>Film filmArray[Max_Film_Num];

how big is a Film struct?  you've only got about 13k *total* working memory
to allocate from with "new", on a PPro.  perhaps you should convert to store
the Film array in a database.  you can always create the database on the
fly, populate it, and delete it when your app terminates.  but if the Film
data is const, why not write a tiny app that creates the Film database.
that way you can pass around both the Film database and your app, and this
makes optimal use of the memory on the device.

you said that DB code makes no sense to you.  many people expect the
database functions to be complicated and work on a "true" database.  but on
the Palm, you can essentially think of a DB as an array of pointers to
amorphous blocks of memory (whose size you specify when you use DmNewRecord
to add a new "row" to the database).  the database functions are extremely
simple.

hope that helps!



Reply via email to