Hi,
Is there a direct way to checking if a type instance is an unextended type, instead of testing against every extended type?
I realise I could tag a type with a custom id, but for reasons of portability etc. I would like to avoid this.
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 EndFunctionI 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.