This is the legacy 4D documentation web site. Documentations are progressively being moved to developer.4d.com |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
4D v20 R7
OB Instance of
|
OB Instance of ( object ; class ) -> Function result | ||||||||
Parameter | Type | Description | ||||||
object | Object |
![]() |
Object whose class is to be tested | |||||
class | Object |
![]() |
Class to test belongship | |||||
Function result | Boolean |
![]() |
True if object belongs to the specified class or a child class, and false otherwise | |||||
The OB Instance of command 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.
Note: Each time a class's sources are modified, a new Class object is generated. As previously instantiated objects do not belong to the new class, OB Instance of will return false if you pass a Class object other than the one used for instantiation.
You created the Polygon class:
//Class: Polygon
Class constructor
C_LONGINT($1;$2)
This.area:=$1*$2
Then, in a method, you can write:
Product: 4D
Theme: Objects (Language)
Number:
1731
Created: 4D v18 R3
4D Language Reference ( 4D v20 R7)