End hook?

BlitzMax Forums/BlitzMax Programming/End hook?

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

Any time my program ends, I just call CloseProgram(), which contains an End command. Is there any way to add a hook so that whenever End is called, my own custom function can be run automatically first?