isClass Method

Class: Class

Description

This method returns an indication of whether a classname is valid. The most likely use for this class is in a compiler command, to include code only when a class of that name is valid in the current environment.

Syntax

Class.isClass(String className)

Parameters

className

The name of the class to look for.

Returns

1 if a class of that name is defined in the OBJECT table, or if the class is a Record class and the associated table is defined.
0 if a class of that name is not defined in the OBJECT table.

When Became Available

v6.4

Example

#IF Class.isClass("MyClass")

 

// compiled only if a class of this name exists here

type MyClass myclass = Class.New("MyClass", "My/Init")

do myclass.myMethod()

type String result = myclass.myOtherMethod(P1,P2)

 

#ENDIF