Watch the videos and practice
Transcript show: 'x = ', x printString
...
Halt now.
Halt now
(or self halt
)
...
Halt once.
To enable it, evaluate
Halt enableHaltOnce
Halt once
, if enabled :
Halt onCount: 10
if: aSelector
stops when invoked from a aSelector
if: aBlock
stops if the block evaluates to true
faces
will stop only when invoked from printString
Dice >> faces
...
Halt if: #printString
The parameter passed to if:
can be a test name too:
Dice >> faces
...
Halt if: #testLargeDice
faces
will stop only when invoked from testLargeDice
now
, once
, onCount:
and if:
are methods in Halt class
Halt class >> between: minTime and: maxTime
(Time current
between: minTime asTime
and: maxTime asTime)
ifTrue: [ self signal ]
Dice >> faces
...
Halt between: '00:00' and: '02:00'
faces
will halt only between midnight and 2am.
/