
Yodl has four macros to modify and/or to set the values of counters. The macros
are: 

itemize(
 
    it() tt(COUNTERVALUE(somecounter)): This macro expands to the value of
    em(somecounter). E.g., if the current value is 2, then the macro writes 2
    on the output file.
    
    it() tt(SETCOUNTER(somecounter)(number)): This macro sets the value of
    em(somecounter) to the value of em(number). The second parameter list must
    be an integer number (i.e., consisting of the characters tt(0) to tt(9),
    optionally prefixed by a tt(-) sign). The macro does not expand to
    anything; i.e., it does not write to the output file.
    
    it() tt(ADDTOCOUNTER(somecounter)(number)): This macro adds the value of
    em(number) to em(somecounter). The number may be negative.
    
    it() tt(USECOUNTER(somecounter)): This macro first increases the value of
    em(somecounter) by 1, and then writes the value of the counter to the
    output file.
    
    This command is particularly useful in combination with tt(NEWCOUNTER):
    since tt(NEWCOUNTER) initializes a counter to zero, tt(USECOUNTER) can be
    used to increase the value and to output it. The first time that
    tt(USECOUNTER) is used on a new counter, the number 1 appears on the
    output file. The next time, number 2 appears on the output file etc..

)

Given the numbering requirements of the hypothetical commands tt(section) and
tt(subsection) (see the previous section), we can now complete the
definitions:

verb(\
NEWCOUNTER(sectcounter)
NEWCOUNTER(subsectcounter)

DEFINEMACRO(section)(1)(\ 
SETCOUNTER(subsectcounter)(0)\ 
USECOUNTER(sectcounter) ARG1)

DEFINEMACRO(subsection)(1)(\ 
COUNTERVALUE(sectcounter).USECOUNTER(subsectcounter) ARG1))
