We can set the reset value of a Integer Count when it is required to reset.
First, you need to click instance option button to add an
instance method. In the counting protocol of
IntegerCount class, add a method reset
reset
"Reset myself ."
| inValue |
inValue := DialogView request: 'Reset to what?'.
self value: (inValue asNumber).
In this method, DialogView is a class used to input a String
via a dialog box. Then asNumber is a method of String to
convert it into a number.
Now, do Count integerCountDemo in Workspace. When you are
asked for the reset value, input an integer.