BREAK

BREAK is a reserved word, used as an input for the DEFEVENT command. It allows you to define a procedure which will be called whenever the Control-G key is pressed. The built-in Logo procedure stops all background procedures as well as the timer event procedure and returns to toplevel.

You should redefine the BREAK procedure with great care. If you do not issue a TOPLEVEL command in your procedure, your Logo programs cannot be interrupted.

Example

The following procedure may act as a replacement procedure for the built-in break procedure. Before returning to toplevel, however, you are asked whether you want to break at all. Note that all background tasks are halted with the HALT command.

TO MY.OWN.BREAK


 * LOCAL "ANSWER


 * PR "BREAK!


 * TYPE [RETURN TO TOPLEVEL? |(Y/N)|]


 * MAKE "ANSWER RC


 * (PR)


 * IF :ANSWER = "Y THEN (HALT) IGNORE TIMER "FALSE TOPLEVEL

END