gettingstarted
[Top] [All Lists]

Preferences

To: gettingstarted at lists dot realsoftware dot com
Subject: Preferences
From: GAmoore at aol dot com
Date: Wed, 30 Mar 2005 23:04:56 EST
Delivered-to: gettingstarted at lists dot realsoftware dot com
I like Joe's idea of value and item. What I was doing was to create a text 
file, but it depended on the order of the lines being written in. So when I 
added or took away preferences that screwed up the user. So I made the first 
"preference" line a preference version number, then put if statements to sort 
it 
out.

But using Joe's idea... as I understand it... I can write preferences like

01red
03blue
09green

or 

09green
03blue
01red

and simply run each line through a loop : grab the first two digits, then run 
it through a sieve of if statements. If I add a new preference, just put a 
new If statement - and it won't hurt earlier pref files.

And to handle the case where a preference does not appear in the pref file, i 
just set them all to the defaults before I even read them in - so reading 
them in, overwrites the defaults. this is especially good for the first time 
the 
user uses the program.
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

<Prev in Thread] Current Thread [Next in Thread>