Skip to content

Instantly share code, notes, and snippets.

@MarkGoldberg
Last active March 6, 2017 20:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MarkGoldberg/66622c33773b265cb7cee05365cd6bc1 to your computer and use it in GitHub Desktop.
Save MarkGoldberg/66622c33773b265cb7cee05365cd6bc1 to your computer and use it in GitHub Desktop.
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