identifying an object via a custom property

Brian Yennie briany at qldlearning.com
Tue Feb 13 21:23:56 EST 2007


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



More information about the use-livecode mailing list