Err... ToString help plz

BlitzMax Forums/BlitzMax Beginners Area/Err... ToString help plz

Ibmurai(Posted 2005) [#1]
I don't get it - why doesn't this work?
type sometype
  function ToString:String()
    'some code - any code...
  end function
end type

The compiler complains that: "Overriding method differs by type"


Ibmurai(Posted 2005) [#2]
Ah.. As it turns out ToString is a method :P


rdodson41(Posted 2005) [#3]
ToString() is a function in the Object type, the basic type in BMX. I think it initially just returns the address of the object in string form. All you have to is find out the correct types of the arguments and return value in the docs, and the override it with those types.