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