create a new unknown type?

BlitzMax Forums/BlitzMax Programming/create a new unknown type?

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.

Such as
Type BaseType
	Field whatever:Int
EndType

Type SomeType Extends BaseType

EndType

Function make_another(mytype:Object)
	Local a:BaseType=BaseType(New mytype)
	
	Assert a,"Not of BaseType"
	
	a.whatever=10
End Function


However you need to make sure all types that are passed inherit from BaseType, the Assert only tests in debug mode.