Best Practices Question

Bill Andersen andersen at mwdental.com
Thu May 28 12:39:39 EDT 2009


andre wrote:
>I use globals when I need sharing the data all across multiple
>scripts, stacks and the like and the data must be forgotten between
>runs. So, I use it for wide spread temporary data but these days I use
>only one global and that global is an array where I can put anything I
>want and still keep the global clutter low.

Hmm, that's a good idea.  That would certianly unclutter the top of
some scripts!

> And I use customprops with data that needs remembering or are multiple
> line. If I need to store the data I am using, I will use a custom
> property or if I am fiddling with some constant or some data that will
> be used by my software as opposed from data that is inputed from
> keyboard or other data sources, then I will use a custom property.
> Common uses for me is storing templates and pieces of messages to be
> assembled later and presented to the user. I also store binary chunks
> in custom properties when needed. For example, storing curl.exe inside
> a custom property and pipeing it out case the windows user does not
> have curl installed and I need it.

This is one area I am having issues.  I'm new enough to Rev that I 
didn't realize fields on my Preferece Page (DB IP Address, DB Name, etc.)
wouldn't be remembered between sessions when I make a Standalone!

Can I take what the user enters in the fields for their Preferences
(database's IP Address, DB Name, etc.) and then assign them to a Custom
Property before they exit the standalone.  Will that keep the data?

OR, do I have to store that in a "prefs" text file and just parse it
at runtime? What do others do?

Bill





More information about the use-livecode mailing list