Is type not extended...

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

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

Hi,

Is there a direct way to checking if a type instance is an unextended type, instead of testing against every extended type?
Type Bob; End Type
Type Jim Extends Bob; End Type
Type Joe Extends Bob; End Type
Type Jan Extends Bob; End Type
Type Jon Extends Bob; 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
	If Jim(i) Return False
	If Joe(i) Return False
	If Jan(i) Return False
	If Jon(i) Return False
	Return True
EndFunction

' Hypothetical singular test
Function IsThisJustABob2(i:Bob)
	If Unextended(Bob(i)) Return True
EndFunction
I would like to avoid having to test against lots of other, potentially unknown, types, and instead simply test once.

I realise I could tag a type with a custom id, but for reasons of portability etc. I would like to avoid this.