Topics

03 Troubleshooting
Designer
LotusScript Terminate

All file handles are now closed when a LotusScript module stops executing, so Sub Terminate doesn't need a "Close" statement.

Terminate can be used for other kinds of cleanup, such as deleting temporary files, but Terminate should be kept as short as possible, because if a module times out during Initialize, Terminate is called and runs to completion. For example, if a module times out after one minute and the module's Terminate runs for two minutes, the total module will run for three minutes.

If a module is halted by control-break, Terminate runs only for a fraction of a second after the control-break, and results are unpredictable.

Halted byInitialize()Terminate()File handles
Normal completionruns to completionruns to completionall close
Timeout during Initialize()stops at timeoutruns to completionall close
Timeout during Terminate()runs to completionruns to completionall close
Control-Break during Initialize()stops at control-breakruns for its first <1 secondall close
Control-Break during Terminate()runs to completioncontinues for <1 secondall close