question on methods and more...

BlitzMax Forums/BlitzMax Beginners Area/question on methods and more...

djdee(Posted 2006) [#1]
ok lets say i have the following code:


----------------------------------
type myType1
field x:float

method getX()
return x
end method
end type


local myInstance:myType1 = new myType1
local y:float = myInstance.getX()
---------------------------------------


now, i dont get a floating point value... i also get problems when trying to return a string. How can i specify what a method returns ? in java i would write the same method like:

public float getX() {
return x;
}

is there a similar way to declare what type the method returns ??


public


TomToad(Posted 2006) [#2]
Method getX:Float()


djdee(Posted 2006) [#3]
thanx!