Admin wrote:

One thing that truly bugs the hell out of me with Live Code is that
when I am done designing/programming and want to test it, the data is
now a part of the program.

In most applications architectures it's common to separate data storage from the user interface, making it easier to update the UI without affecting the user's data.

To use such an approach you would load the data from a file and set the values of controls used to display the data on preOpenCard (field contents, button values, etc.).

With standalones this will be necessary unless you make your UI stack as a separate stack file apart from the executable, since modern OSes don't allow apps to modify themselves.

Data storage may be a prefs file or a document file, depending on the nature of the data.

With LiveCode you have a wide range of formats available. For large tabular data sets you can use SQLite, define your own format using simple text files, store arrays using arrayEncode, or even use custom properties stored in a stack file (a favorite of mine since it lets me use name-value pairs very conveniently.

Sarah Reichelt's helpful article on saving data from a standalone may be helpful:
<http://livecodejournal.com/tutorials/saving_data_in_revolution.html>

All that said, we still haven't addressed your central question: during development you'll likely have controls displaying data values that need to be cleared - how do we do that?

Since the olden days I've been fond of writing a handler called "StripAndShip" which I include in my mainStack, which takes care of resetting UI elements to their default states.

In more recent years, the LiveCode IDE now sends a savingStandalone message, which can be trapped to handle that sort of stuff for a clean build.

--
 Richard Gaskin
 Fourth World
 LiveCode training and consulting: http://www.fourthworld.com
 Webzine for LiveCode developers: http://www.LiveCodeJournal.com
 LiveCode Journal blog: http://LiveCodejournal.com/blog.irv

_______________________________________________
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Reply via email to