Was this helpful?
IsDescendantOf Method
The IsDescendantOf method returns TRUE if the field object is a descendant at any level of the specified ancestor. It returns FALSE if the FieldObject is not part of the field referenced by the ancestor parameter.
This method has the following syntax:
smallint = FieldObject.IsDescendantOf(ancestor = FieldObject)
For FormFields, the value of ancestor should be a CompositeField. For MenuFields, the value of ancestor should be a MenuGroup.
This method is useful in generalized ChildExit events to see if the field being exited is part of a given composite field. For example, in the ChildExit event handling for a subform called addr_form, you can use the following 4GL code to see if the last user event caused the input focus to move out of the subform:
if CurFrame.TargetField.IsDescendantOf(ancestor =
    field(addr_form)) = FALSE
        then ...
        /* ... leaving subform ... */
    endif;
Note:  OpenROAD considers a field object to be a descendant of itself.
Last modified date: 06/25/2024