Inherited methods

BlitzMax Forums/BlitzMax Programming/Inherited methods

Perturbatio(Posted 2005) [#1]
when you inherit a method in a type, you can then use that in the child type, but if you override the method it will no longer run the code in the previous method.

Is there any way to override the method, run the inheritied method's code AND your new code?

i.e. in Delphi you do
procedure DoSomething(X:Integer, Y:Integer); override;
begin
   inherited; //run inherited method's code
   //do something else here
end;



Arcadenut(Posted 2005) [#2]
Yeah, you have to use Super

Method DoSomething(P_x%, P_Y%)
   Super.DoSomething(P_x%, P_y%)
   ' Do something else...
End Method



Perturbatio(Posted 2005) [#3]
*doh* I forgot all about super.

thanks :)