DirectCast Function
Syntax:
Group:
Description:
Returns expr's type is related to objtype type. If it is not, a "type mismatch error" will occur.
Parameters:
Parameter |
Description |
---|---|
Cast the value of this expression. |
|
Cast to this type. |
Example:
Sub Main Dim V As Object V = Err
Debug.PrintTypeName(DirectCast(V, ErrObject)) ' ErrObject
EndSub