ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Jaroslav Hajtmar <hajtmar@gyza.cz>
To: "ntg-context@ntg.nl" <ntg-context@ntg.nl>
Subject: Disproportion in initializing user counters
Date: Sun, 15 Jul 2018 10:33:08 +0000	[thread overview]
Message-ID: <3F5673DB-D866-4B1E-A152-DB16E85AAB46@gyza.cz> (raw)


[-- Attachment #1.1: Type: text/plain, Size: 913 bytes --]

Hello ConTeXist.
I encountered a disproportion in initializing user counters. Why initialization at the beginning of the source text does not work and what is the mechanism of how the user counters work.

Thanx Jaroslav Hajtmar

Here is a sample example:

\definecounter[mycounter]

\def\getmycounter{\incrementcounter[mycounter]\getnumber[mycounter]}

\startbuffer[groups]
    \startxrow
    \startxcell \getmycounter\stopxcell
    \startxcell Content of column\stopxcell
\stopxrow
\stopbuffer



\starttext

%\setcounter[mycounter][0] % initializing at this point not working (the counter is 10 more than it should be). WHY?



\startxtable
    \startxrow
        \startxcell Column 1\stopxcell
        \startxcell Column 2\stopxcell
    \stopxrow

\setcounter[mycounter][0] % initializing at this point works fine
\dorecurse{5}{\getbuffer[groups]}
\stopxtable

\stoptext


[-- Attachment #1.2: Type: text/html, Size: 5390 bytes --]

[-- Attachment #2: Type: text/plain, Size: 492 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

             reply	other threads:[~2018-07-15 10:33 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-15 10:33 Jaroslav Hajtmar [this message]
2018-07-15 13:49 ` Hans Hagen
2018-07-15 14:47   ` Pablo Rodriguez
2018-07-15 17:20     ` Wolfgang Schuster
2018-07-15 17:34       ` Pablo Rodriguez
2018-07-15 17:54         ` Rik
2018-07-15 18:10           ` Pablo Rodriguez
2018-07-15 23:18       ` Jaroslav Hajtmar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3F5673DB-D866-4B1E-A152-DB16E85AAB46@gyza.cz \
    --to=hajtmar@gyza.cz \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).