Skip to main content
Version: 20 R7 BETA

OB Class

OB Class ( object ) -> Function result

ParameterTypeDescription
objectObjectObject whose class is to be returned
Function resultNull, ObjectClass of object

Description

The OB Class command returns the class of the object passed in parameter. In 4D, all objects inherit from the Object class. If object is not an existing object, OB Class returns null.

Example

You created the Polygon class:

  //Class: Polygon
 
 Class constructor
 var $1;$2 : Integer
 This.area:=$1*$2

Then, in a method, you can write:

 var $poly;$class : Object
 $poly:=cs.Polygon.new(4;3)
 
 $class:=OB Class($poly)
  //$class contains Class: Polygon

See also

OB Instance of