We can set the reset value of an AsciiCount when it is required to reset.
First, you need to click instance option button to add an
instance method. In the counting protocol of
AsciiCount class, add a method reset
reset
"Reset myself ."
| inValue |
inValue := DialogView request: 'Reset to what?'.
self value: (inValue first).
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 asciiCountDemo in Workspace. When you are
asked for the reset value, input a string (only the first character will be used for the resetvalue).