Type Ship Field XPos:Int,YPos:Int Method X(XPos:int=-9999) if XPos = -9999 then return self.XPos self.XPos = XPos End Method End Type
Its untested, but I was thinking that you would call it like this:
X = MyShip.X() ' get X
MyShip.X( 100 ) ' set X
[edit] looks like I was a little slow and HappyCat have already suggested something similar. I think it would work just fine.