End hook?

BlitzMax Forums/BlitzMax Programming/End hook?

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?

Try:

OnEnd( fun() )

Found it, thanks.