IsObjectOfClass - cObject
Determines whether the passed class is part of the object's class hierarchy
Type: Function
Return Data Type: Boolean
Parameters
| Parameter | Type | Description |
|---|---|---|
| iClass | integer | The class id to check the hierarchy of |
Syntax
Function IsObjectOfClass integer iClass Returns Boolean
Call Example
Get IsObjectOfClass iClass to BooleanVariable
Description
This returns True if the passed class is part of the object's class hierarchy. This can be very useful because it allows you to determine if an object should understand certain interfaces.
Boolean bIsGrid bIsList
Get IsObjectOfClass (RefClass(cWebGrid)) to bIsGrid
Get IsObjectOfClass (RefClass(cWebList)) to bIsList
If bIsGrid Begin
// customize for grid
End
Else If bIsList Begin
// customize for list
End
Else Begin
// customize for unknown
End
This does not consider mixin classes - only the main class is considered in the hierarchy.
Note: Some of our windows classes have an odd class hierarchy, which does not 100% match how we represent the classes in our documentation (this includes the GUI runtime windows DFBaseXxxxx classes). This function reflects this inconsistency. In most cases, this occurs at a level where it will not matter.
See Also
Name | Object_Id | Object_Label | ObjectClass | IsObjectOfClass | IsClassOfClass
Return Value
This returns True if the passed class is part of the object's class hierarchy