func_system_onend.rst 659 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. .. _func_system_onend:
  2. =====
  3. OnEnd
  4. =====
  5. OnEnd -
  6. Description
  7. ===========
  8. .. code-block:: blitzmax
  9. OnEnd( fun() )
  10. Add a function to be called when the program ends
  11. #OnEnd allows you to specify a function to be called when the program ends. OnEnd functions are called
  12. in the reverse order to that in which they were added.
  13. Parameters
  14. ==========
  15. Return Values
  16. =============
  17. Nothing.
  18. Examples
  19. ========
  20. .. code-block:: blitzmax
  21. ' onend.bmx
  22. Function cleanup()
  23. Print "cleaning up"
  24. End Function
  25. OnEnd cleanup
  26. Print "program running"
  27. End 'the cleanup function will be called at this time
  28. See Also
  29. ========