Skip to main content

objectClass

objectClass ( object : object ) : object

ParameterTypeDescription
objectobject->Object whose class is to be returned
Resultobject<-Class of object or null if not found

Description

The objectClass command returns the class of the object passed in parameter.

All objects inherit from the Object class. If object is not an existing object, objectClass returns null.

Example

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, class : object
poly = cs.Polygon.new(4,3)

class = objectClass(poly)
//class contains Class: Polygon

See also

objectEntries
objectValues