Single Point Property Creation/Assignment

Ken Ray kray at sonsothunder.com
Thu Aug 4 01:03:06 EDT 2005


On 8/3/05 11:02 PM, "Stephen Barncard" <stephenREVOLUTION at barncard.com>
wrote:

> Hi gang,
> I'm creating a central management system for settings using user properties.
> I want to use one central routine to access the preferences stack.
> 
> To do that, I am working with a handler that creates and sets a
> custom property INSIDE a custom property set - all set at once. I got
> the below code to work.
> 
> My question is -- is the use of 'do' the only or best way to
> accomplish the use of variables for assigning property names and
> data? Or am I missing the obvious?

Well, as long as the variable holds a value, you don't need to use "do" for
the *variable* part of it, i.e. this:

  put "Test" into tProp
  set the uPropSet[tProp] of this stack to "Hello"

is the same as:

  put "Test" into tProp
  do "set the uPropSet[" & quote & tProp & quote & "] of this stack to" &&
quote & "Hello" & quote

However you can't get away with it for property sets or values... so the
only way to do this is with "do", as you've put in your email.


Ken Ray
Sons of Thunder Software
Web site: http://www.sonsothunder.com/
Email: kray at sonsothunder.com





More information about the use-livecode mailing list