Extends problem

BlitzMax Forums/BlitzMax Beginners Area/Extends problem

Hi all,

I am starting my first BMAX project and have already hit a problem i don't understand.

I have created a class called TObject which defines the prototype/interface of all other objects and looks like this.

TObject.bmx
Type TObject
	Field Name
	Field X#,Y#
	Field XSpeed#,YSpeed#
	Field Direction

	Function Create(name) EndFunction
	
	Function UpdateAll() EndFunction
	
	Method New() EndMethod
	
	Method Update() EndMethod

	Method Destroy() EndMethod

	Method Draw() EndMethod
End Type


I then start to create a new class that extends this object class. and looks like this.

TSwitch.bmx
Include "TObject.bmx"

Type TSwitch Extends TObject
	Global List:TList
	Global Image:Timage
		
	Function Create(name)
		name:TSwitch = New TSwitch	 
		If List = Null List = CreateList()
		List.AddLast name 'Add Ship Last in List
	EndFunction
	
	Function UpdateAll()
	
	EndFunction
	
	Method New()
		X = 300
		Y = 400
	EndMethod
	
	Method Update()
	
	EndMethod

	Method Destroy()
	
	EndMethod

	Method Draw()
	
	EndMethod
End Type


But when i compile the TSwitch.bmx i get the error saying "Identifier type does not match declared type"

Can someone please explain what i have done wrong.

Cheers