Page 1 of 1

Add InsertPreferences/ExtractPreferences

Posted: Tue Mar 25, 2025 6:16 pm
by Quin
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

Posted: Tue Mar 25, 2025 9:33 pm
by Marc56us
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.

Re: Add InsertPreferences/ExtractPreferences

Posted: Tue Mar 25, 2025 10:23 pm
by nsstudios
+1

Re: Add InsertPreferences/ExtractPreferences

Posted: Tue Mar 25, 2025 10:24 pm
by Quin
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.
Structured flat data files? Who's to say it would have to be structured and flat? If I did:

Code: Select all

Structure Prefs
    General.GeneralPrefs
EndStructure

Structure GeneralPrefs
    Name.s
EndStructure
This would create a general section in the ini file with name, in my mind.