Log In    |    Knowledge Base    |    4D Home
Tech Tip: Gracefully clearing processes
Published On: February 27, 2007

There are four ways that 4D clears a process. The first two conditions are automatic:

  • When the process code finishes executing
  • When the user quits from the database
  • If you stop the process procedurally or use the Abort button in the Debugger
  • If you choose Abort from the Process menu in the Design environment

The last two methods of clearing the process are obviously planned, and although neither exits the process gracefully it can be assumed that the designer chose to use that method to exit the process. The first method is also assumed to be graceful because in this case the process has finished executing.

Out of these four methods though, the second is not advised and may sometimes cause problems. When 4D quits a database it cannot clear any processes that are paused. This may cause 4D to hang instead of immediately exiting (4D will still eventually exit by simply aborting the process). It is a good practice to ensure that all processes have been resumed in the On Exit method before 4D actually tries to clear the processes out.

If a database is hanging when exiting one way to check and see if paused processes are the cause is to use the TRACE command at the end of the On Exit method. Once there the Debug Window has a processes option which will show what processes are still running and their status. If that status is "paused" then that may be the problem.

Processes documentation: