Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Clarion - test of using an interface to call into a derived class from a reference to it's parent
PROGRAM
MAP
END
include('debuger.inc'),ONCE
DBG debuger
iGoAway INTERFACE
GoAway PROCEDURE
END
ctRoot CLASS,IMPLEMENTS(iGoAway),TYPE
DESTRUCT PROCEDURE()
END
ctFromRoot CLASS(ctRoot),IMPLEMENTS(iGoAway),TYPE
DESTRUCT PROCEDURE()
END
oFromRoot &ctFromRoot
oRoot &ctRoot
CODE
dbg.mg_init('TestDispose')
oFromRoot &= NEW ctFromRoot
oRoot &= oFromRoot
oRoot.iGoAway.GoAway()
!DISPOSE( oRoot )
ctRoot.DESTRUCT PROCEDURE()
CODE
dbg.DebugOut('ctRoot.Destruct')
ctRoot.iGoAway.GoAway PROCEDURE()
CODE
dbg.Debugout('in ctRoot.iGoAway.GoAway')
DISPOSE( SELF )
ctFromRoot.DESTRUCT PROCEDURE()
CODE
dbg.DebugOut('ctFromRoot.Destruct')
ctFromRoot.iGoAway.GoAway PROCEDURE()
CODE
dbg.Debugout('in ctFromRoot.iGoAway.GoAway')
DISPOSE( SELF )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.