Skip to main content
Version: Next

objectClass

objectClass ( object : object ) : object

ParameterTypeDescription
objectobjectObject whose class is to be returned
ResultobjectClass 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