How to store desktop app settings?

I wonder how to do that:
under win XP, (or any other OS, if possible),
The app needs to store a few paths (maybe up to 15) and when a new one is added delete the older one etc . . .
Also store the window position and size, to recall the next time it is opened.
(If you also know where to find infos ( store the window position and size) to do it, it’ll be great.)
Thanks in advance for your precious help.

Take a look at the blog post I did on saving preferences:

I guess I am “old school”. I built a set of functions to read and write old format INI files. It works in a Web App (server stored files) or a desktop app. It works in Windows and OS X but I have not tried Linux but it should.

I like them because I can use a text editor to make changes if needed and they are “semi” structured in form and easy to visually understand.

If you are interested I will share.

I did the same… works great on all platforms

www.rdS.com/inifile.xojo_xml_project.zip

You should also check out classPreferences on Github :slight_smile:

I got a large choice to pick a solution.
Great help , thank you all.
I’ll read all and choose the one I’m able to understand (at least, partly).
Out of curiosity I may try classpreferences because I would like to know a bit about sqlite with xojo, that’ll be a good start, but I may adopt a simplest one like ini , json or xml.
Anyway I have lots of learning ahead.

I use SQLite to store all sorts of data about my app. Very useful. Saves settings, data, etc.

And the nice thing is I can have a user send me their database (I even have a utility for them to upload it to me) and I can load it here on my system and basically get their settings. It’s been very useful for troubleshooting issues or misconfigurations users have had.

I also use text based CSV files as well. Easy to edit in Excel or Numbers…

One of the best idea I read about in… years (?)
at last for this month.

I save all preferences on a simple txt file under the libs folder, this file is obviously autoloaded.
If the app doesnt find this file or if the file has been messed up then it resorts to default settings.

I don’t know if this is “good coding practice” but it works for me so far

As long as you’re not storing passwords or sensitive information inside, you’re okay.

I’m also interested in this issue.
I know, there were a discussion earlier… but I can’t find it in my bookmarks.
How to save settings in the user folder in each different OS. (Win, Mac and Linux.)

Maybe you compile only for one OS but still, the technique can be used with the OS you use.

the class I posted about above works in all platforms