"the effective visibility"

Eric Chatonet eric.chatonet at sosmartsoftware.com
Sun Aug 10 03:40:27 EDT 2008


Bonjour Tereza,

Brilliant :-)

Le 9 août 08 à 15:49, Tereza Snyder a écrit :

> On Aug 9, 2008, at 6:56 AM, Bernard Devlin wrote:
>
>> Hi Eric
>>
>> I'm afraid it is worse than that.  Things like this are not  
>> reliable: "get
>> the cpValue of the owner of field mydata", where the owner is a  
>> group.
>> Sometimes it will work, other times Rev will actually return the  
>> contents of
>> another field in another group (and these are not controls that  
>> were created
>> on the fly).  Since wasting a whole day tracking down that bug (in  
>> code that
>> had appeared to be working for weeks), I now _always_ get the long  
>> id of
>> (for example) field myData, and then parse the long ID.
>
>
> Here's an easy—and I suspect faster—way to parse the long id for  
> traversal up the hierarchy of objects:
>
> get the long id of the selectedobject; replace " of " with "," in  
> it; put it
>
> which results in:
>
>    field id 226375,group id 226358,group id 226332,card id  
> 224190,stack "..."
>
> then a simple "for each item" loop to traverse it.
>
> The engine doesn't have to fetch the ID but once.



Best regards from Paris,
Eric Chatonet.
----------------------------------------------------------------
Plugins and tutorials for Revolution: http://www.sosmartsoftware.com/
Email: eric.chatonet at sosmartsoftware.com/
----------------------------------------------------------------





More information about the use-livecode mailing list