Counter
Last updated
Was this helpful?
With a counter, you maintain a numerical value, for example a production count or sequence number. You can increment, decrement, and reset the count. You must create an instance of the counter to use it. The code class name is Counter.
createCreates a new counter instance, optionally starting from an initial value.
initial
The number to start counting from. Default 0.
integer
Returns the name of the created instance.
# initial
10deleteDeletes a counter instance.
None.
Returns true upon removal.
incrementIncrements the counter's value by one.
None.
Returns the new count as an integer.
decrementDecrements the counter's value by one.
None.
Returns the new count as an integer.
resetResets the counter back to its initial value. You can optionally provide a new initial value to use for this and all future resets. A value of 0 cannot be set as a new initial value; in that case the counter resets to the previously configured initial value.
initial
An optional new initial value.
integer
Returns nothing.
getCountRetrieves the current value of the counter.
None.
Returns the current count as an integer.
Last updated
Was this helpful?
Was this helpful?
# initial
100