Docly Developers
Function Updated 17 Oct 2026

Chstep(name)

Adds 1 to the last number of the counter: "2" becomes "3", and "2.0" becomes "2.1". A counter that does not exist yet starts at "0", so the first chstep gives "1".

The counter is a text value of numbers separated by dots, such as "2.1", and is written out with #name#. The function itself returns an empty string, so #chstep("c")# writes nothing. The function names are lower case: chinit, chstep, chdestep, chpush, chpop.

Parameters

namestringrequired

Name of variable to store chapter counter in.

Returns

Nothing, just increments the variable.

Example

Mixed HTML (or any text file) with inline JavaScript between hash signs.
#chstep("counter1")#
#chstep("counter1")#

Counter 1 value is: #counter1#