Forward declaration

BlitzMax Forums/BlitzMax Beginners Area/Forward declaration

Once you've created the instance in your Create function, you can set the fields and call the methods on it, i.e.:

Type THouse
  Field Floors:Int
  Function Create:THouse()
    Local tmpHouse:THouse=New THouse
    tmpHouse.Floors=2
    tmpHouse.MakeRoof
    Return tmpHouse
  End Function

  Method MakeRoof()
    'Some code
  End Method
End Type