Break Points

Break points can be set in Smalltalk methods to force sim execution to stop so that you can see what is going on. Here are some useful ways to set break points:

JwServices currentTime > 23.67

This break point will stop execution in the method when the sim time is greater than 23.67.

bseId = #'BLUE_AIRPLANE'

This break point will stop execution in the method when the bseId = the symbol #BLUE_AIRPLANE. Symbols with underscores must be entered using single quotes. All subclasses of BattleSpaceEntity respond to the message bseId.

You can set a break point on any condition or variable, including method temporary variables, that is 'visible' (exists) in the method.

someMethod
 
| flightTime |
 
flightTime := 0.
bseId = #'BLUE_AIRPLANE' 
    ifTrue: [flightTime := 3]
^flightTime

You could set a break point on the temporary variable flightTime like this:

flightTime = 3

or

flightTime > 2

on the line ^flightTime to stop execution.

To see what instance variables a method understands, browse the class that owns the method, and then select 'Browse References → To an instance variable' from the right click menu.