Arrays and Custom Props --not trivial- agreed

Jim Ault JimAultWins at yahoo.com
Sat Feb 14 19:45:24 EST 2009


>Jim Ault's good overview in response to this thread
> shows that strategies for developing a working relationship with
> custom props is not trivial.
Agreed.  Just as building a good set of database linked tables (schema)
takes some planning, so do custom properties.

Accessing database records is very fast, and so is accessing a custom
property.  Storing very large amounts of data in fields is a much, much
slower method of (storage, updating and accessing).  Most of us don't build
projects of large enough scale to see the difference.

One of the great things about Rev is that you have choices.
One trick for easy visibility plus fast operation is:
--store settings and preferences in a field,
--  then on closefield, copy the text to a single custom property
--  just as you do the single field
--   thus you can have it both ways!
Good for the IDE and better for the user

on closefield
   put the short date && the short time into line 1 of me  --time stamp
   set the cpPrefsField of this stack to me -- eg. fld "prefsAndSettings"
   save this stack
   get the cpPrefsField of this stack
   put the lineoffset("backgroundColor", it) into pos
   put line 1 of it & cr & line pos of it into msg
end closefield

Compiling the standalone will lock in both versions of the text, but script
access using the custom property will be much faster.  Remember, any changes
to a field in a standalone can not be saved in the standalone, the same for
any changes made by the user or a script.

Jim Ault
Las Vegas

On 2/14/09 11:19 AM, "Gregory Lypny" <gregory.lypny at videotron.ca> wrote:

> Well, Bernard and Scott, good to know I'm not alone.  I've always
> been ambivalent about custom properties.  I see their power and
> usefulness, but more often than not, I spare myself the mental strain
> of recalling what prop is stored where, what it is called, and how to
> display all of the ones I have set, by instead using a hidden field
> dedicated to "settings" or "preferences", which I can call up in a
> snap or display all the time while I'm scripting, and edit by typing
> into it.  This field of settings can be loaded into one or more arrays
> at start up.  Jim Ault's good overview in response to this thread
> shows that strategies for developing a working relationship with
> custom props is not trivial.
> 
> Regards,
> 
> Gregory
> 
> 
> On Fri, Feb 13, 2009, at 11:13 PM, Bernard wrote:
> 
>> Don't feel too bad.  So the dictionary does contain an example for
>> what you
>> needed, but after 6 years of using Revolution I still have to look
>> up how do
>> work with custompropertysets & arrays almost every time I use them
>> together!
>> Not to mention that I can never remember which way round 'split' &
>> 'combine' work.
>> I think I must have been particularly stupid at the time when I was
>> learning
>> how to use arrays, and my confusion has been permanently wired into
>> my brain
>> :-)
>> 
>> Bernard
> 
> 
> 
>> on mouseUp
>>   put "that makes 2 of us" into response["Bernard"]
>> end mouseUp
>> 
>> Regards,
>> 
>> Scott Rossi
> 
> 
> [Jim Ault followed his comment below with a good overview of working
> with custom properties.]
> 
>> Just a couple hints that might help you in the future..  I hope this
>> can
>> help someone understand a little more.
> 
> 
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution





More information about the use-livecode mailing list