"the effective visibility"

Tereza Snyder tereza at califex.com
Sat Aug 9 09:49:01 EDT 2008


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.


t


More information about the use-livecode mailing list