Most common used cross-platform way to save preferences?

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
CoffeeCone
Posts: 64
Joined: Fri Apr 26, 2013 8:38 am

Most common used cross-platform way to save preferences?

Post by CoffeeCone » Sat Apr 27, 2013 3:00 pm

I want to know what is the defacto standard used by LC developers when saving their user-changed app settings? Do you store it as INI file somewhere? What do you use? For example, the last window size and position.

Also, how do I center the application window?
Learning LiveCode, one step at a time.

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7393
Joined: Sat Apr 08, 2006 8:31 pm
Contact:

Re: Most common used cross-platform way to save preferences?

Post by jacque » Sat Apr 27, 2013 6:50 pm

If it's plain text data, I just use a text file. If it's binary, I use a stack and set custom properties in the stack to hold the data. I also use a stack if the data holds confidential info and needs to be obscured, because the stack can be password protected which encrypts the custom properties so they can't be read. Then I write the file (text or stack) to the specialFolderPath("preferences") for desktop, or "documents" for mobile, or in some cases to the app support folder, depending on usage and OS.

I think that's a pretty standard way to do it in LiveCode. When your stack opens, you just open the prefs file invisibly and read the data you need to retrieve.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

Post Reply