New() method

BlitzMax Forums/BlitzMax Beginners Area/New() method

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.

You can't, not in BlitzMax.

Add a Create function to your Type. e.h.

Type TSomething
     Field x:Int
     Field y:Int

     Function Create:TSomething(x:Int,y:Int)
         Local obj:TSomething = New TSomething
         obj.x = x
         obj.y = y
         Return obj
     EndFunction
EndType

Local myVar:TSomething = TSomething.Create(100,100)