Import not working?
Monkey Forums/Monkey Beginners/Import not working?
| ||
I want to import some methods so my sourcecode gets smaller and easier to edit. So the first lines of my code are: Strict Import standards and the first line of "standards" is: Method handle_createparticles:Int(explx:Int,exply:Int,noofp:Int,pbshp:Int,pspd:Int,pspdd:Float,plf:Int) and it gives me an "Syntax Error - expecting declaration" ???? |
| ||
Can you post the code? |
| ||
this (in standards) should work:Function handle_createparticles:Int(explx:Int,exply:Int,noofp:Int,pbshp:Int,pspd:Int,pspdd:Float,plf:Int) End Function To declare a method, you should declare it in a class: (standards) Class Testclass Extends App Field font:Int Field inp:Int Field textBoxText:String Method handle_createparticles:Int(explx:Int,exply:Int,noofp:Int,pbshp:Int,pspd:Int,pspdd:Float,plf:Int) End Method End Class and then in the base .monkey: Import standards Function Main() Local myVar:Testclass = New Testclass myVar.handle_createparticles(1,2,3,4,5,6.2,7) End Function |