isDecendant Method

Class:  Class

Description

This method indicates whether the class named in the first argument is a descendant of the class named in the second argument.

Syntax

Class.isDescendant(String className1,String className2)

Parameters

className1

The name of the descendant class

className2

The name of the ancestor class

Returns

A Boolean:

1 if the class named by className1 is a descendant of the class named by className2.
0 if the class named by className1 is not a descendant of the class named by className2.

When Became Available

v7.0

Example

// wrong order presumably

type Boolean NO = Class.isDescendant("Record","RecordDEP")

 

type Boolean YES = Class.isDescendant("String","Primitive")

 

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

set NO  = Class.isDescendant("Runtime","Reference")

set YES = Class.isDescendant("Class","Object")

 

//If second name is "Object", result is always 1 EXCEPT:

// (no class is a descendant of itself)

set NO  = Class.isDescendant("Object","Object")