Debugging Facilities
Debugging Facilities
In any application, debugging facilities are necessary to help find and correct any logic errors in an application. In event driven applications, debugging can be more difficult since it is impossible to predict what a user could request.
The Framework provides a number of facilities that can be incorporated into applications to make debugging easier. For example, a “spy” window can be opened that displays events and actions as they occur.
Sample Spy Window
Many of these facilities would not be included in the final version of an application but are extremely useful during development.
The Spy Window displays information about the current program, the current window, the current form, the most recent event, and the latest action. Each of these has an associated button that displays more details about each category of information. pSpy is integrated with pGetAction to ensure that the information about the window, form, event, and action is up to date. The program information relies on each program responding to an action named GETSTATUS. The Example Application code provides examples of how programs should respond to this action by providing information about their current state to pSpy.
pSpy is started by the command line pSpy(“OPEN”) and closed by the command line pSpy(“CLOSE”). In addition, by assigning a special menu item tag, you can create a menu item that opens the spy window. See Event and Action Mapping and pSpy.
Debug Settings and Framework Tracing
Zim and the Framework provide a number of debugging and tracing facilities. These debug options can be managed using pSystemSettings. In addition, each of the Framework programs contains tracing that displays key information to the current output document. This tracing can be activated by a call to pSystemSettings. In addition, by assigning a special menu item tag, you can create a menu item that toggles Framework tracing on and off. See Event and Action Mapping and pSpy.