Thanks for the info. I had thought that global variables were persistent, like app prefs are. After your answer, I dug deeper into the code I had been looking at and saw how they are getting the app prefs upon startup, loading the global variables from there, and then doing the opposite upon appStop.
Brian ------------------------------------------------------- Subject: Re: storing state : global variables or application prefs? From: "C. B. Schofield" <[EMAIL PROTECTED]> Date: Tue, 14 Jan 2003 12:56:11 -0700 X-Message-Number: 49 On 1/14/03 12:34 PM, "Brian Preston" wrote: > Another newbie question (thanks Ben for answering my > last one ) : > > Which of these is better for storing state? What are > the pros/cons? I've read a little in the Palm OS > Companion about application preferences, and I've > looked at some source code of other apps that use a > lot of global variables. Global variables are not persistent - that is, they don't exist when the application is not running. Globals are initialized when the application launches, and trashed when the application exits. Application preferences, on the other hand, do persist between executions of the application. Craig __________________________________________________ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
