isAncestor Method

Class:  Class

Description

This method indicates whether the class named in the first argument is an ancestor of the class named in the second argument.

Syntax

Class.isAncestor(String className1,String className2)

Parameters

className1

The name of the ancestor class

className2

The name of the descendant class

Returns

A Boolean:

1 if the class named by className1 is an ancestor of the class named by className2.
0 if the class named by className1 is not an ancestor of the class named by className2.

When Became Available

v7.0

Example

type Boolean TRUE  = Class.isAncestor("Record","RecordDEP")

 

// wrong order presumably

type Boolean FALSE = Class.isAncestor("String","Primitive")

 

// Class, Db, and Runtime descent directly from Object

set FALSE = Class.isAncestor("Reference","Db")