Is type not extended...

BlitzMax Forums/BlitzMax Programming/Is type not extended...

use a method or field with extended value true or false

Type Bob
	Method extended(); EndMethod
End Type
Type Jim Extends Bob
	Method extended(); Return True;EndMethod
End Type
Type Joe Extends Bob
	Method extended(); Return True;EndMethod
End Type
Type Jan Extends Bob
	Method extended(); Return True;EndMethod
End Type
Type Jon Extends Bob
	Method extended(); Return True;EndMethod
End Type

Local a:bob = New bob
Print "unextended bob? "+IsThisJustABob(a) 

' Test against other classes, potentially
' hundreds of types would need testing, and
' some of them may be "unknown" to this part of the code
Function IsThisJustABob(i:Bob)
	If i=Null Return False
	Return Not i.extended()
EndFunction