identifying an object via a custom property

Hershel Fisch hershf at rgllc.us
Wed Feb 14 16:53:19 EST 2007


On 2/13/07 9:23 PM, "Brian Yennie" <briany at qldlearning.com> wrote:
Thanks, this is what I used till now. But I'm trying to eliminate so many
looping.
Hershel

> Hershel,
> 
> Before doing anything more complex, have you tried simply looping
> through the objects? This should be pretty fast unless you have an
> enormous number of fields.
> 
> For example (using your "groupOrder" custom property), you could
> provide a simple lookup function which returns the first field with a
> matching custom property value. This could be extended of course
> depending on your needs.
> 
> function groupOrderToID pOrder
>   repeat with i=1 to (number of fields)
>      if (the groupOrder of field i is pOrder) then return the id of
> field i
>   end repeat
> end groupOrderToID
> 
> And then:
> 
> focus on field id (groupOrderToID(3))
> 
> HTH,
> Brian
> 
>> On 2/13/07 6:40 PM, "Mark Schonewille" <m.schonewille at economy-x-
>> talk.com>
>> wrote:
>> 
>>> Hi Hershel,
>>> 
>>> Make a setprop handler that stores a flag in a custom property of
>>> your stack or in a global variable. When you want to know which
>>> objects have ther property set, just use the second custom property
>>> or the global variable to read out the information.
>> Sorry didn't get it.
>> Thanks, Hershel
> _______________________________________________
> 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