
The code below defines a number and then on each row, displays then increments the number. The number is defined and reset to 0 before the table is declared. However, when the number is displayed in the table, it's not zero as expected, but some other number (usually between 3 and 9). The reset at reset point #1 does reset the number to 0, but it doesn't stay that way when the table is declared. The only thing I have found to work, is to define a row and column and put the reset there (see reset point #2). I would like to declare and reset the number outside of the table definition, but it doesn't seem to work. What am I doing wrong? \definenumber[MyNum] \starttext \resetnumber[MyNum] % reset point #1 \bTABLE % \bTR\bTD \resetnumber[MyNum] \eTD\eTR % reset point #2 \bTR\bTD \getnumber[MyNum]\incrementnumber[MyNum] \eTD\eTR \bTR\bTD \getnumber[MyNum]\incrementnumber[MyNum] \eTD\eTR \bTR\bTD \getnumber[MyNum]\incrementnumber[MyNum] \eTD\eTR \bTR\bTD \getnumber[MyNum]\incrementnumber[MyNum] \eTD\eTR \eTABLE \stoptext

Bart Wise schrieb:
the table is passed several times to get the size maxima, etc. your number is also incremented in every pass (how many passes?). ;) use something like this to take care of trial typesetting: \definenumber[MyNum] \def\IncrTABLEnum[#1]% {\iftrialtypesetting \hbox{00}% allocate some space in the first pass \else \getnumber[#1]\incrementnumber[#1]% \fi} \starttext \resetnumber[MyNum] % reset point #1 \bTABLE % \bTR\bTD \resetnumber[MyNum] \eTD\eTR % reset point #2 \bTR\bTD \IncrTABLEnum[MyNum] \eTD\eTR \bTR\bTD \IncrTABLEnum[MyNum] \eTD\eTR \bTR\bTD \IncrTABLEnum[MyNum] \eTD\eTR \bTR\bTD \IncrTABLEnum[MyNum] \eTD\eTR \eTABLE \stoptext best, peter
participants (3)
-
Bart C. Wise
-
Bart Wise
-
Peter Rolf