ON event Statements Programming Examples The following programming examples show how to integrate ON event statements, statements that enable traps, and event-handling subroutines into a working program: