Weather / Spam / www |
Lyon Weather
aldweb against spam
|
|
|
|
|
|
|
- Forum - iziBasic
Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 257
Topic # 1425 |
Keep App in Memory |
12/06/2006 @ 18:14 by Colonel Kernel
|
Hi, How do I keep my app in memory, like how Memo Pad comes up with the last doc I viewed?
I have a simple Baseball related app which needs to retain its info for a few hours at a time. All of the information currently is one word or one number.
I think I could do it by writing to the preferences after each event and loading them at start up. I could probably also do it by writing to a doc of some kind, but I think that's a bit advanced for my first app.
I also see the SAVESCREEN and LOADSCREEN commands, but am not sure how they're used.
Thanx again and, as before, a small code example with explanations is best.
Ciao, Bill |
|
|
Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Answer n° 1 -------- 12/06/2006 @ 18:37 by Colonel Kernel
visitor |
Follow up thought regarding the Preferences method - - I don't think I'd need to write to them after every single event. But if I did it every so often and when the exit event is recorded should be enough.
Again, thanx. |
|
|
Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Answer n° 2 -------- 13/06/2006 @ 03:00 by Lou
visitor |
You should only need to save the preference(s) when the exit event occures (e=-1).
I've found that saving many preferences can slow down exiting the app. Not a big problem, but it causes an annoying white screen for a second or two. I suggest parsing several data into a few preferences, then unparsing (?) when you load the preferences at the beginning of your code.
Also be sure to handle the case where no preferences have been saved; LOADPREF will return zero.
Lou |
|
|
Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Answer n° 3 -------- 13/06/2006 @ 20:05 by Colonel Kernel
visitor |
Thanx, Lou. I thought that'd work for saving the current app status but I wanted to check.
I already encountered an empty pref issue when it occurred to me that the system couldn't load a pref if it was never set. I guessed an empty string pref would return "" and it works, so I guess I was right.
To follow up, what are SAVESCREEN and LOADSCREEN used for?
Thanx again, Bill |
|
|
Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Answer n° 4 -------- 14/06/2006 @ 19:02 by Colonel Kernel
visitor |
Actually, I had an opportunity to guess last night. Some drawn graphic elts were disappearing after I opened and closed another form on top of them. SAVESCREEN and RESTORESCREEN seem to make sure they come back. |
|
|
Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Answer n° 5 -------- 17/06/2006 @ 01:36 by bh77a
visitor |
You might want to save your data to a simple database. Aldweb has provided some terrific samples in the program archive. Look them over and if you have some questions, let us know.
Regards, bh77a/brian |
|
|
topic active
topic closed
Sticky
New message -
Correct message
Close topic
Make sticky
|
|
|
|
|
|