Hello Gee,

> If I declare a new chunk using MemPtrNew in a function, does the memory
stay
> after the function exits?

Yes. The memory chunk is allocated in the "dynamic heap" and stays
until you free it, or until your program terminates. But, you shouldn't
rely on it being freed by the OS (free it explicitly yourself).

> If it does, then does that mean that I'll need some sort of global
> variable to store the pointer so that it can be de-allocated using
> MemPtrFree?

The scope of the variable does not have to be global. It just has to
be around when you issue the MemPtrFree.

Recommended reading: "Targeting Palm OS" and "Palm OS Programmer's
Companion". You will need to get a well-rounded understanding of programming
for Palm OS. This platform has features, and limitations, which are
different than most people have dealt with before.

Good luck!

-----Steve Jackson



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