Hi Aditya, yes, looking at the .tuo did the trick. :-D I had tried things with expanded already, but at that time I still had
{\expanded{\Issue[\IssueCounter]{Issue~\IssueCounter:}{\currentdate}}} as command. Which does NOT work (due to the tilde ~ resulting in an error message then) The rest was actually fine. Now, without it (i.e. "~") it works! ... {\expanded{\Issue[\IssueCounter]{Issue: \IssueCounter:}{\currentdate}}} ...
Thanks a lot, that had me seriously baffled ;-) Carsten On 12.01.2008 at 23:29 wrote Aditya Mahajan:
Hi Carsten,
On Sat, 12 Jan 2008, Carsten Fechtmann wrote:
What this all burns down is, that I /really/ would like to understand, how I can pass a value from a counter as (constant) argument to a self- defined function. As that seems to be the core of the matter/problem here.
You need to understand how synonyms work. It writes enteries to the tuo file, and then uses that in the second pass to sort things. One way to make sure that you have the correct entry in the tuo file is to use expanded:
\definesynonyms[Issue][issues][\IssueText][\IssueDate] \setupsynonyms[Issue][criterium=all]
\newcounter\IssueCounter
\def\NewIssue{\dosingleargument\doNewIssue}
\def\doNewIssue[#1]% {\increment\IssueCounter %Debug: \IssueCounter / \getnumber[IssueNumber]% \doifelsenothing{#1} {\expanded{\Issue[\IssueCounter]{\IssueCounter}{\currentdate}}} {\expanded{\Issue[\IssueCounter]{\IssueCounter}{#1}}}}
% Compare the tuo file with and without expanded and you will know what is % happening.
\starttext \NewIssue[January 9, 2008] \NewIssue[January 10, 2008] \NewIssue % January 11, 2008
List of issue \# and dates:
\placelistofissues \blank
\IssueDate{\IssueCounter} % produces correct result in either case
\stoptext
Aditya ___________________________________________________________________________________ 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://tex.aanhet.net archive : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________