Hi: I apologize for asking such a basic question. What is the correct way to increment a counter such that each time a macro is used, the counter is augmented by 1. So far, I have \newcount\MyCounter and have tried \advance\MyCounter by1 and a few other things I found online, but whenever I try to increase its value by 1, all references to it's value return 1. Not a particularly useful counter ;-) . Thanks, Matt
I apologize for asking such a basic question. What is the correct way to increment a counter such that each time a macro is used, the counter is augmented by 1. So far, I have \newcount\MyCounter and have tried \advance\MyCounter by1 and a few other things I found online, but whenever I try to increase its value by 1, all references to it's value return 1. Not a particularly useful counter ;-) .
Hmmm... It can happens for many reasons. Try for instance \global\advance\MyCounter by 1\relax \the\MyCounter % \relax is not always obligatory but treat it as a goode habit
Hi
% \relax is not always obligatory but treat it as a goode habit
^^^^^ What I wanted to say by 'goode'? Sorry for that... I sent it too fast. Sorry for any other mistakes in my messages. Belive me, it's not my negligence. I work hard on it... Pawe/l
% \relax is not always obligatory but treat it as a goode habit What I wanted to say by 'goode'? While it is not an English word (says the Oxford English Dictionary)
Hello, On Wed, Sep 17, 2003 at 11:10:37PM +0200, Pawel Jackowski na Onet wrote: there is Goode, Richard (Stephen) (b NY, 1943). Amer. pianist. Début NY 1962 (NY Young Concert Artists). Eur. début Spoleto Fest. 1964. Member of Boston Symphony Chamber Players 1967-9 and of Chamber Mus. Soc. of Lincoln Center, NY, 1969-79 and 1983-9. Won 1st prize Clara Haskil comp. 1973. Wide repertory and has recorded complete cycle of Beethoven sonatas. (The Concise Oxford Dictionary of Music.) Doesn't sound too bad ;) Tobias
% \relax is not always obligatory but treat it as a goode habit What I wanted to say by 'goode'? While it is not an English word (says the Oxford English Dictionary) there is Goode, Richard (Stephen)
And it is a olde(!) english form of "good" as well, medieval I think. Grüßlis vom Hraban! -- http://www.fiee.net/texnique/
Hi,
Matthew Huggett
I apologize for asking such a basic question. What is the correct way to increment a counter such that each time a macro is used, the counter is augmented by 1.
"Pawel Jackowski na Onet"
Hmmm... It can happens for many reasons. Try for instance ...
General remark (not really concerning this thread): It would be nice if the original posters would comment answers like this one if this works fine or not. Since these mails are archived, other people might come across this post and wonder if this is a good solution or not. Just my $50^{-1}$ Euro Patrick -- Silent is the goldfish in its bowl
Patrick Gundlach wrote:
Hi,
Matthew Huggett
writes: I apologize for asking such a basic question. What is the correct way to increment a counter such that each time a macro is used, the counter is augmented by 1.
"Pawel Jackowski na Onet"
writes: Hmmm... It can happens for many reasons. Try for instance ...
General remark (not really concerning this thread):
It would be nice if the original posters would comment answers like this one if this works fine or not. Since these mails are archived, other people might come across this post and wonder if this is a good solution or not.
Just my $50^{-1}$ Euro
Patrick
Yeah, the solution worked. Just to recap: What I wanted was a macro and counter such that each time the macro gets used the counter gets augmented + 1. The solution was: \newcount\MyCounter \define[1]\MyMacro{ \global\advance\MyCounter by 1 \relax \number\MyCounter #1} \starttext \MyMacro{Hello} \MyMacro{Goodbye} \MyMacro{Hello again} \stoptext --> 1Hello 2Goodbye 3Hello again Matt
At 00:04 22/09/2003 +0900, you wrote:
\newcount\MyCounter \define[1]\MyMacro{ \global\advance\MyCounter by 1 \relax \number\MyCounter #1}
\starttext \MyMacro{Hello} \MyMacro{Goodbye} \MyMacro{Hello again} \stoptext --> 1Hello 2Goodbye 3Hello again
or, using pseudo counters: \define[1]\MyMacro {\doglobal\increment\MyCounter \MyCounter#1} or even \define\MyCounter{\doglobal\increment\MyCounter\MyCounter} Hans ------------------------------------------------------------------------- Hans Hagen | PRAGMA ADE | pragma@wxs.nl Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com ------------------------------------------------------------------------- information: http://www.pragma-ade.com/roadmap.pdf documentation: http://www.pragma-ade.com/showcase.pdf -------------------------------------------------------------------------
"Patrick Gundlach"
[...] It would be nice if the original posters would comment answers like this one if this works fine or not. Since these mails are archived, other people might come across this post and wonder if this is a good solution or not.
Just my $50^{-1}$ Euro
Ok, I will do my best to comment messages in more readable way. Pawe/l
participants (6)
-
Hans Hagen
-
Henning Hraban Ramm
-
Matthew Huggett
-
Patrick Gundlach
-
Pawel Jackowski na Onet
-
Tobias Burnus