Home > Language Reference > Classes > Object
Implements Function
Determines whether the object implements the features of a given class.
Syntax
Public Function Implements(ByVal lTypeID As Long) As Boolean
| Parameter | Description |
| lTypeID | Type identifier. |
Remarks
The Implements function determines whether the object it is applied to implements the features of the class specified by the lTypeID parameter. In other words, it checks whether the actual type of the object derives from this class or not, and therefore if the object can be safely casted to this type.
The lTypeID parameter specifies the type identifier of a class. This value is obtained through a call to the TypeID function, and should be considered as opaque. If the actual type of the object derives from this class, the function returns True, otherwise it returns False.
The following example tests whether the methods of the StreamMemory class can be used on an arbitrary stream or not:
Public Sub DoSomeStuffWithAStreamMemory(ByRef s As Stream)
Dim sm As StreamMemory
If s.Implements(TypeID(StreamMemory)) Then
Set sm=StreamMemory(s)
' Code that uses sm goes here
Else
Err.Raise 1000, "Invalid parameter: StreamMemory expected"
End If
End SubFor more information about objects and type conversion, please refer to the Objects section in this documentation.
System requirements
| System | Minimal version | Remarks |
| Palm OS | Palm OS 3.0 | N/A |