Skip to content

Latest commit

 

History

History
29 lines (17 loc) · 1.38 KB

TPJCustomConsoleApp-OnWork.md

File metadata and controls

29 lines (17 loc) · 1.38 KB

OnWork event

Project: Console Application Runner Classes

Unit: PJConsoleApp

Classes: TPJCustomConsoleApp, TPJConsoleApp

Applies to: ~>3.0

property OnWork: TNotifyEvent;

Description

This event is triggered when the executing application yields control to this class. The frequency with which the event is triggered depends on the value of the TimeSlice property - the smaller the value the more frequently the event is triggered.

Handle the event to perform any required processing between time slices. Examples of the kind of processing you may wish to perform are:

  • Updating a progress meter in the main application, or reporting time to live or elapsed time since the application began executing.
  • Processing data written by the console application to redirected standard output or standard error. The most common way to do this is via a pipe.
  • GUI applications that update the user interface should call Application.ProcessMessages in the OnWork event handler to let the application refresh the interface.

This event is never triggered if TimeSlice is INFINITE.

Remarks

The event is public in TPJConsoleApp and protected in TPJCustomConsoleApp.