Storing and saving a setting in a stand alone

Richard Gaskin ambassador at fourthworld.com
Thu Jan 15 10:13:26 EST 2015


Shawn Blc wrote:
> Can someone point me in the right direction?
> I want to save a setting in stand alone application. This setting will be
> different for each person (name).
>
> Once it's set, the user won't be prompted to enter again.

OSes don't allow applications to modify themselves.   Back in the olden 
days Mac Classic did, but that was due to a bifurcated file system long 
since recognized as needing replacement, so Apple discourages use of the 
resource fork in modern apps.  And without a resource fork, runtime 
modification of an executable isn't possible.  Most other OSes have had 
this convention in place since their beginnings.

Data can be stored outside of the executable in a nearly infinite range 
of formats, including SQLite, text files, XML, JSON, encoded arrays, or 
even stack files using custom properties.

When storing user data, it's helpful to put it into the user-writable 
folders recommended by the OS vendor - see the specialFolderPath 
function for details on that.

Sarah Reichelt's article describes this in more detail, and includes 
tips for working with externally-stored data:
<http://livecodejournal.com/tutorials/saving_data_in_revolution.html>

-- 
  Richard Gaskin
  Fourth World Systems
  Software Design and Development for the Desktop, Mobile, and the Web
  ____________________________________________________________________
  Ambassador at FourthWorld.com                http://www.FourthWorld.com




More information about the Use-livecode mailing list