Tutorial Chapter 4: Query by Example / Allowing the User to Cancel the Query Operation |
If the user selects Cancel during the CONSTRUCT, the built-in global integer variable INT_FLAG is automatically set to TRUE.
LET INT_FLAG = FALSE CONSTRUCT BY NAME where_part ... END CONSTRUCT IF INT_FLAG = TRUE THEN ... END IF
The statement DEFER INTERRUPT in your MAIN program block will prevent your program from terminating abruptly if a SIGINT signal is received. When using a GUI interface, the user can generate an interrupt signal if you have an action view named 'interrupt' (the predefined interrupt action). If an interrupt event is received, TRUE is assigned to INT_FLAG.
It is up to the programmer to manage the interruption event (stop or continue with the program), by testing the value of INT_FLAG variable.
Interruption handling is discussed in the report example, in Tutorial Chapter 9: Reports.