Docly Developers
Function Updated 17 Oct 2026

Chdestep(name)

Subtracts 1 from the last number of the counter: "2.3" becomes "2.2".

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 change.

Returns

Nothing, just decrements the variable.

Example

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

Counter value is: #counter1#

#{
    chdestep("counter1");
}#

Counter value is: #counter1#