virtual?

I am designing a base class and I expect those who derive from it must implement the decompress method.
How do i indicate that in the base class in xojo?

raise an exception in the method in base class telling it’s missing.
or put break command there, so you stop there in debugger.

Add an Event Definition to your base class and name it Decompress. In your subclasses, you’ll need to add this event (Add > Event Handler).

I agree with Christian. If the subclass implements the method, the base class code will never run and the exception never trigger. But if it doesn’t, the base class code will be called.

I see what you’re saying… if the method isn’t implemented by the subclass an exception will be thrown.
I wonder if there is a speed issue with defining an event as Eric suggested?

The problem with an event is that there’s no way for you to know whether it is implemented by the subclass or not.

@[quote=45648:@Tim Hare]The problem with an event is that there’s no way for you to know whether it is implemented by the subclass or not.[/quote]

Sure there is - require that subclasses return true in the event. If the event returns false, the super can know that it wasn’t handled by the subclass.

[quote=45639:@Brian O’Brien]I see what you’re saying… if the method isn’t implemented by the subclass an exception will be thrown.
I wonder if there is a speed issue with defining an event as Eric suggested?[/quote]

I’ve never noticed one. I use events all over the place like this, as does the built-in framework.