If canceled

Command group Flag affected Reversible Execute on client Platform(s)
Constructs NO NO NO All

Syntax

If canceled ([No refresh])

Options

No refresh If specified, the command does not refresh the screen; this may result in improved performance on some platforms, especially when the command is used in each iteration of a loop

Description

This command tests whether the user wishes to cancel execution of the current method, and branches if not. The user requests a cancel by either clicking on a working message Cancel button, or by pressing Ctrl-Break under Windows, Ctrl-C under Linux, or Cmnd-period under macOS. If Enable cancel test at loops is switched on, a loop or other processing may detect a cancel and quit all methods before it is detected by an If canceled command.

Example

Calculate #F as 1
Disable cancel test at loops
Working message (Cancel button) {Doing some work}
Repeat
  Redraw working message
  If canceled
    OK message (Icon,Sound bell) {Method Terminated.}
    Quit method
  End If
Until flag false