11-20-2008, 03:57 AM
Join Date: Nov 2008
Post Thanks: 0
Thanked 0 Times in 0 Posts
| | Using RecordStore for options database
Please Login to Remove!
After having wrapped my head around RecordStore (I think) I've decided it's (finally) time to implement options in my educational (for me not the user) program. Primarily I want to know if the method I intend to use is optimal, I'm not looking for code, once I come up with the procedure I'm pretty sure I can handle that. I'm having difficulties figuring out how to say what I am intending to do, so I'll try explaining through example.
Let's say my program has three options. At Program start it will open a RecordStore (and create if neccessarry) and see if it has any options set, if it does they will be read to appropriate variables, and if not it will asign default values, and save these defaults to the recordstore.
That seems a fairly simple thing to do, check the size of the record store, and if it's 0 then it's empty, and proceed to set the options.
When the User goes to set the options, we asume the exist in the recordstore (as it shouldn't be possible to get to this point without having set them), so we read them in and set the UI to match. If options change we just cylce through the options and save to the appropriate recordID.
Now where I hit some bumps is, what if in a later version I decide to add some options. first off, when a program is updated to a later version number, does it still have access to the same recordstore? If not then it's a simple solution and doesn't need any extra work. However if it does then I could have some issues. For example, should options 1 and 2 be related (lets say they both relate to sounds played, and option 3 is completely unrelated. Now if I decide to add another option I either have the RecordIDs of the options out of order (this may not affect the user but it bother's me aesthetically, and seems as though it would make code awkward) or I have to completely reset the options if the RecordStore is the wrong size.
So I suppose an additional question would be, what method would be best? I can see pros and cons on both sides, out of order Option RecordIDs seems like it would tend to be in favor of the user, as options will be consistent between upgrades, and resetting to defaults would seem in favor of myself and maintanence in general.