Was Void taken out?

Monkey Forums/Monkey Programming/Was Void taken out?

Chroma(Posted 2013) [#1]
Method OnCreate:Void()

End Method

How come I can't use Void with the above?


Xaron(Posted 2013) [#2]
You can't because the base method has :Int() as return value. You can't override it with a different return value.


Nobuyuki(Posted 2013) [#3]
OnCreate(), OnUpdate(), and OnRender() all return Int, presumably for debug/error checking purposes. Like Xaron said, when extending/overriding these, you have to also return Int. In strict mode, this also means there must be a Return value. (I recommend Return 0 as this is what would happen without Strict. If you hit an error you want to return early from, you can return a negative number...)