Just use globals for such a small amount of data. If you need persistance
(so you can open the current form on launch and still return to the correct
previous form) then use the preferences with a current and previous form ID
variable/structure member. You can track your return field in a similar
manner.

Also, allocating individual chunks for small amounts of seldom changed data
is a waste of time especially when you have to manage the dealloc. If you
have enough of these, amalgamate them into one structure and allocate a
chunk for that.

If the data is small and transient (a small buffer to do a SPrintF etc),
then prefer the stack over a chunk or a global. It cleans itself up.

It is also a good idea to encapsulate the FrmGotoForm functionality so that
you have a standard way to transit from one form to another and the
necessary return info is required as arguments so you don't forget. Unlike
Tony, I would recommend that you do NOT override the FrmGotoForm function -
make your own instead. That way you won't forget to supply the required
return info.

"Wilson, Mike E." <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> I have need of creating a global variable to track which form is calling
my custom created calendar form so I can always return to the calling form.
I have read that it is preferred to use Memory Chunks vs. Globals. Which one
is the best way and what is a simple example of how to use both?
>
> Problem: Single custom calendar form that calculates and creates the right
calendar for any date from the year 1 to 9999. I only have one form but many
other forms it is called from and in some places multiple places on the same
form so I need to track what form and what field to return the selected day
value to.
>
> Help is desperately needed on this. I know how to do it using NSBasic but
the code has gotten bloated so I have switched to C to redo the application
for both performance and size.
>
> Regards,
>
> Michael W.
>



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

Reply via email to