Skip to main content


instanceOf ( object : object , class : object ) : boolean

objectobject->Object whose class is to be tested
classobject->Class to test belongship
Resultboolean<-True if object belongs to the specified class or a child class, and false otherwise


The instanceOf command returns returns true if object belongs to class or to one of its child classes, and false otherwise.

If class is not a valid Class object, the error -10745 is returned.


You created the Polygon class:

  //Class: Polygon

constructor(size1 : integer, size2 : integer)
this.area = size1*size2

Then, in a method, you can write:

 var poly : object
var instance : boolean
poly =,3)

instance = instanceOf(poly,cs.Polygon) //true
instance = instanceOf(poly,4D.Object) //true
instance = instanceOf(poly,cs.Circle) //false

See also