Method Spies


 | tools+ | restore | home |

What are Method Spies?

Inserting a Spy

Editing a Spy

Spy Examples


  Inserting a Method Spy

Inserting a Spy into a Method is done simply by placing the text cursor at the point where the spy is required, and pressing the F9 key. The position of the spy will be confirmed by the selection of the source code immediately following the location where the spy will be inserted, and you will be prompted to enter the code for the method spy:

Once a spy has been inserted into a method, the method is marked with the Method Spy icon - a pair of dark glasses:

Within the source code of the spied method, the location of the spy is specified by an area of red background (configurable via the sourceFormats option):

Note that it is not necessary to place the text cursor exactly at the insert point for the spy; the first sensible position for the spy will be selected and highlighted for confirmation (of course, if the highlighted area is not what you intended, you may cancel the operation).


Inserting a Breakpoint

Inserting a method spy to execute a simple self halt breakpoint is such a common requirement that it is assigned its own shortcut key: simply place the text cursor at the required place in the method source, and press ‘Break’. A method spy with the code self halt will be immediately inserted.

To quickly insert a Break at the very start of the method, the context menu of the method list also has an ‘Insert Break’ option, and also responds to the ‘Break’ key.


© 2002 Solutions Software Ltd.