Chpop(name) Last updated: 30. May 2026

Steps down one level on the counter (for multi level counters).

Parameters

Name Type Description
name string

Name of variable to store chapter counter in.

Returns

Nothing, just removes a level from the counter.

Example

Code example (#JS)

#JS is mixed HTML (or other text file) with inline JavaScript with # starting and ending each inline statement.
#{
    chinit("counter1");
    chstep("counter1");
    chstep("counter1");
    chpush("counter1");
    chstep("counter1");
    chstep("counter1");
}#

Counter value is: #counter1#

#{
    chpop("counter1");
}#

Counter value is: #counter1#

Output

The #JS code above produces the output shown below:

Counter value is: 2.2


Counter value is: 2