Hi Hraban, Hans, Taco, I followed this thread with interest. By coincidence I was struggling with this kind of problem during the last days. Thanks so much for this educative example! In my case I have to fill in a table with the information concerning parcels to be sent. Some times there is a single one sometimes there are multiple pieces. For each of the parcels I have to fill in a table-row. And voilà! The community cooked up the pieces I missed. Thanks again. Willi Henning Hraban Ramm wrote: > (This mail was rejected as spam in my first try, and the reject > message was catched by my spam filter...) > > Am 2006-01-03 um 11:51 schrieb Taco Hoekwater: > >> You need to expand the \Set commands in that first loop, >> otherwise you store the literal token \recursevelel inside >> the definitions of the Key and Val macros (\setvalue{}{} >> autoexpands its first argument, but not its second argument). >> >> When not inside a recursion, \recurselevel expands to the number >> 0 (zero) in the "manual bit", and you are actually re-evaluating >> the macro using the then current \recurselevel definition >> when inside the "looping" bit. > > > The magic expansion hit me again, I should've known it. > >> So you need: >> >> \dostepwiserecurse{1}{9}{1}{ >> \expanded{\Set{\recurselevel}{K\recurselevel}{V\recurselevel}} >> } >> >> I hope this is clear enough? > > > Thank you very much! > Actually, in the real environment I needed the \expanded at another > place: > > \def\Sender#1#2#3{\setvalue{SenderKey#1}{#2}\setvalue{SenderVal#1}{#3}} > \def\GetSenderLine#1{\bTR\bTD\doiftextelse{\getvalue{SenderKey#1}} > {\getvalue{SenderKey#1}:}{}\eTD\bTD\getvalue{SenderVal#1}\eTD\eTR} > % initialize values (not even needed) > \dostepwiserecurse{1}{9}{1}{ > \Sender{\recurselevel}{}{} > } > > \startsetups sendertablesetup > \setupTABLE[frame=off] > \setupTABLE[x][1][width=\senderkeywidth, align=left, > style={\keystyle \strut}] > \setupTABLE[x][2][width=\sendervalwidth, align=right, style= > {\valstyle\strut}] > \bTABLE > \dostepwiserecurse{1}{9}{1}{% count from 1 to 9, step 1 > \expanded{\GetSenderLine{\recurselevel}} > } > \eTABLE > \stopsetups > > I collect this (and more) at http://wiki.contextgarden.net/ > Talk:Letter_style > > > > Grüßlis vom Hraban! > --- > http://www.fiee.net/texnique/ > http://contextgarden.net > http://www.cacert.org (I'm an assurer) > > _______________________________________________ > ntg-context mailing list > ntg-context@ntg.nl > http://www.ntg.nl/mailman/listinfo/ntg-context