On Jan 20, 2015, at 9:14 PM, Geoff Canyon wrote:

> 2. It's a feature that custom property names can be stored/referenced using
> variables. For example:
> 
>   repeat for each item P in "left,top"
>      -- not custom properties, but the same principle applies
>        set the P of button "example" to 10 * trunc(the P of button
> "example" / 10)
>   end repeat

A little late to this thread, but I couldn't resist generalizing this really 
nifty idea:

on initializeCprops propList,tObjRef,tDelim
   -- initialize a list of custom properties in one swoop
   -- proplist is a comma-delimited list of <cPropName><tDelim><value>, eg:
   --    put "tGender^M,tTown^Cambridge,nextAppt^1 month" into propList
   --    initializeCprops propList,the long id of this card,"^"
   -- tDelim defaults to <space> if empty
   -- from an example by Geoff Canyon, use-LC list,
   --    adapted by Peter M. Brigham, pmb...@gmail.com
   if tDelim = empty then put space into tDelim
   split propList using comma and tDelim
   repeat for each key K in propList
      set the K of tObjRef to propList[K]
   end repeat
end initializeCprops

-- Peter

Peter M. Brigham
pmb...@gmail.com
http://home.comcast.net/~pmbrig


_______________________________________________
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