Storing an Array as a Custom Property

Ken Ray kray at sonsothunder.com
Sat Oct 2 00:15:23 EDT 2010


> Instead the simplest I've found is this:
> 
>    on mouseUp
>      put "gaskin" into tPropSet
>      put "richard" into tProp
>      set the customPropertySet of me to tPropSet
>      set the tProp of me to "Howdy!"
>    end mouseUp
> 
> Is there a way to make that a one-liner using array notation?

The only way I can see to do it is with "do"; and maybe use merge to make it
a bit cleaner:

on mouseUp
  put "gaskin" into tPropSet
  put "richard" into tProp
  put "Howdy!" into tVal
  do merge("set the [[tPropSet]][ [[tProp]] ] of me to tVal")
end mouseUp

Note that you need to have a spaces around [[tProp]] otherwise you get an
error...


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





More information about the use-livecode mailing list