Thread debugging
Previous  Next

Threads may only be used in an optimised compiled Basic4PPC applications. However debugging a compiled application is more complicated and tedious than debugging in the IDE with its' interactive debugger. In a compiled application debugging is limited to displaying debugging information in MsgBoxes and Labels or TextBoxes.

This library can be run in the IDE, and in legacy compiled applications, but will display a warning when New, Start, RunLocked or Join are invoked. New will create the Threader object but Start, RunLocked and Join do nothing. Sleep, Yield and Abort do not warn and appear to work though in fact Abort does nothing.

The four properties are all functional and in particular FireDebugEvent and FireThreadEvent are also functional so it is possible, with a little program modification, to do some debugging of thread code logic in the IDE debugger. The reason for providing two events is that events relating to proper program execution can be separated from events that might be needed only for debugging making it easier to clean up the final code after debugging.

It is probable that more than one sort of event needs to be raised but Basic4PPC cannot pass data from library events to a Basic4PPC event Sub. Global variables can be used to pass data to a FireDebugEvent or FireThreadEvent Sub  and to signas what is required to be done.