Add InsertPreferences/ExtractPreferences
Add InsertPreferences/ExtractPreferences
As an application gets more and more complicated, storing all user configuration data in a structure seems like a good idea. However, if we're using the preferences library, there's no easy way to load this data like there is with JSON/XML/etc. Is it possible to add functions that can load/save preference files using structures?
Re: Add InsertPreferences/ExtractPreferences
Hi,
I don't know, but personally, I don't like structured flat data files, so I'd avoid using pref files in any way other than the one intended.
Similarly, Json and XML have both advantages and disadvantages
Advantage: Single-pass backup readout
Disadvantage: a single character error can render the file unreadable
In addition, both are very difficult to edit manually.
If the pref file becomes too large, the best solution is an SQLite database. (IMHO)
This is what some browsers (i.e. Firefox) do for bookmark.
I don't know, but personally, I don't like structured flat data files, so I'd avoid using pref files in any way other than the one intended.
Similarly, Json and XML have both advantages and disadvantages
Advantage: Single-pass backup readout
Disadvantage: a single character error can render the file unreadable
In addition, both are very difficult to edit manually.
If the pref file becomes too large, the best solution is an SQLite database. (IMHO)
This is what some browsers (i.e. Firefox) do for bookmark.
Re: Add InsertPreferences/ExtractPreferences
Structured flat data files? Who's to say it would have to be structured and flat? If I did:Marc56us wrote: Tue Mar 25, 2025 9:33 pm I don't know, but personally, I don't like structured flat data files, so I'd avoid using pref files in any way other than the one intended.
Code: Select all
Structure Prefs
General.GeneralPrefs
EndStructure
Structure GeneralPrefs
Name.s
EndStructure