How to override a create function?

BlitzMax Forums/BlitzMax Beginners Area/How to override a create function?

The Forum Archive is locked. These are the original blitzbasic.com forums, kept so their posts can still be read and searched. No new topics, replies or edits can be made here. To join the conversation, head over to the Blitz3D+ forums.

Hi Gents I'm getting Null pointer exceptions when attempting to override a parents Create method e.g.

Type testA
	Field x:Int
	Field y:Float
	Function Create:testA(newx:Int)
		newA:testA = New testA
		newA.x = newX
		Return newA
	End Function
End Type

Type testB Extends testA
	Function Create:testB(newx:Int)
		Return testB(Super.Create(newx))
	End Function
End Type
'Test Harness

Graphics 640, 480, 0

Global test:testB
test = testB.Create(10)
test.y = 5

While Not KeyHit(KEY_ESCAPE)
	Cls
	Flip
	FlushMem
Wend

This generates an unhandled exception on this line :
test.y = 5
What I'm trying to do is ensure the old version of create is called by default in the new version so I can then add additional elements. Unfortunatly I'm doing something fundamentally wrong?!

Can you help?

Regards

Merx