Skip to main content
Version: 21 R3

OB Class

OB Class ( object : Object ) : Object

ParameterTypeDescription
objectObject→Object whose class is to be returned
Function resultObject←Class of object (null if object does not exist)
History
ReleaseChanges
18 R3Created

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( $width : Integer ; $height : Integer)
 This.area:=$width*$height

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

Properties​

Command number1730
Thread safeyes