Enable cancel test at loops

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

Syntax

Enable cancel test at loops

Description

This command causes Omnis to test if the user wishes to cancel execution of the method, at the end of each loop and during lengthy operations such as searching or sorting a large list. 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. This command reverses the Disable cancel test at loops command. Unless Omnis has executed a Disable cancel test at loops, cancel testing is carried out automatically.

Example

; delete all overdrawn accounts without interruption by the user requesting a cancel
Set main file {fAccounts}
Set search as calculation {fAccounts.Balance<0}
Find on fAccounts.Code (Use search)
Disable cancel test at loops
While flag true
  Working message (Repeat count) {Deleting Account [fAccounts.Code]}
  Delete
  Next on fAccounts.Code (Exact match)
End While
Enable cancel test at loops ;; enable break key for next loop