The ancestry of function can be applied to any object. The value returned is the string associated with the parent(s) of the specified object.
The following example illustrates the syntax used to represent ancestry. If the object Child1 is defined as:
Child1 in ParentN in ... in Parent2 in Parent1
the ancestry of function would return:
Parent1/Parent2/.../ParentN
For example, if you want to add a new object into the coordinate system of the parent of an existing object, you could use the ancestry of function:
response to AddWindow
add blue graphical region NewRegion size 510 280
at position XCalculated YCalculated
in ancestry of BigWindow
If you specify the ancestry of function for an object for which no ancestry has been defined, ESL returns the name of the primary region. For objects that have no ancestry, such as dialog boxes and the primary window, a null string is returned, indicating that the object was created in the desktop - that is, it has no parent.
Be careful not to confuse the ancestry of function with the ancestry function. The ancestry function is a response inquiry, returning the string associated with the ancestry of the object that stimulated the response. (See Using Response Inquiry Built-in Functions for details on the use of the ancestry function.)