D
Don
1. Say I have three classes: A, B and C.
2. Class A can only be inherited, and B inherits it. C does not inherit
anything.
3. I have a function that can have an object passed to it. Either B or C
can be passed to it.
4. In this function, I need to determine whether the object passed to it
inherits A or not.
In pseudo-code:
Function MyFunction(object)
If object.Inherits(A) Then
Return "Inherits A"
Else
Return "Does not inherit A"
End If
End Function
MyFunction(B) --> "Inherits A"
MyFunction(C) --> "Does not inherits A"
Is there any way to do this?
- Don
2. Class A can only be inherited, and B inherits it. C does not inherit
anything.
3. I have a function that can have an object passed to it. Either B or C
can be passed to it.
4. In this function, I need to determine whether the object passed to it
inherits A or not.
In pseudo-code:
Function MyFunction(object)
If object.Inherits(A) Then
Return "Inherits A"
Else
Return "Does not inherit A"
End If
End Function
MyFunction(B) --> "Inherits A"
MyFunction(C) --> "Does not inherits A"
Is there any way to do this?
- Don