error with list.Node
Monkey Forums/Monkey Programming/error with list.Node
| ||
anybody have an idea why I am getting this error:Field node:list.Node<Tball> I get error: Module 'list' not found I did import the Mojo module. |
| ||
Have you modified your monkey module somehow? |
| ||
No, Not at all. to make sure I downloaded just now and run it but still get the same error. |
| ||
Does this work? Import monkey.list |
| ||
no. I get a "duplicate Identifier error." here:Global list:List<Tball> |
| ||
Does a single file with just this compile in your Monkey setup?Function Main() Local a:list.Node<MyClass> End Function Class MyClass end |
| ||
Yes, It works. Also, I tried putting it in a global in the main program and it doesn't give me any errors but using it as a field or a global in that class does: maybe something else is wrong with that class: Class Tball Extends vector Field pc:TPoint Field rollx:Float Field rolly:Float Field roll:Float Field radius:Float Field number:Int Field mass:Float Field color:Int Field vtxList:List<vertex> Field stp:Float Field node:list.Node<Tball> the vector class only contain the fields vx,vy,dx,dy and length |
| ||
It's difficult to tell without having the complete source code. |
| ||
I'll try to figure it out by elimination if I can't solve it I'll post the source code. either way I'll post my results. |
| ||
well, I got it to the minimum it will give me the error. It seems that it can't mingle arrays of <T> with nodes of <T>. or simething like that.Import Mojo Global ball:Tball[16] Global list:List<Tball> Function Main:Int() ball[0] = Tball.Create(0,0,10,$FFFF00, 1,50,0,0) ball[0].node = list.AddLast(ball[0]) End Function Class Tball Field node:list.Node<Tball> Function Create:Tball(x:Int,y:Int,r:Int,color:Int,num:Int,m:Float,vx:Float = 0,vy:Float = 0) Local c:Tball = New Tball Return c End Function End Class it smells of a monkey bug to me. |
| ||
can this thread be moved to the monkey bug section or should I start a new one? |
| ||
This compiles:Import Mojo Global ball:Tball[16] Global ballList:List<Tball> Function Main:Int() ballList = New List<Tball> ball[0] = Tball.Create(0,0,10,$FFFF00, 1,50,0,0) ball[0].node = ballList.AddLast(ball[0]) End Function Class Tball Field node:list.Node<Tball> Function Create:Tball(x:Int,y:Int,r:Int,color:Int,num:Int,m:Float,vx:Float = 0,vy:Float = 0) Local c:Tball = New Tball Return c End Function End Class BTW: ewwww at Tball... just use Ball ;) |
| ||
I am an Idiot! thanks Therevills. that should do it. although, I don't know why the error wasn't more specific. BTW: ewwww at Tball... just use Ball ;) just a port from BlitzMax. I thought about renaming it before posting it for that same reason. / |