From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/25001 Path: news.gmane.org!not-for-mail From: Willi Egger Newsgroups: gmane.comp.tex.context Subject: Re: serial definition Date: Fri, 06 Jan 2006 22:25:36 +0100 Message-ID: <43BEE050.8070702@boede.nl> References: Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------040200080907050305080703" X-Trace: sea.gmane.org 1136588004 7732 80.91.229.2 (6 Jan 2006 22:53:24 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 6 Jan 2006 22:53:24 +0000 (UTC) Original-X-From: ntg-context-bounces@ntg.nl Fri Jan 06 23:53:20 2006 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from ronja.vet.uu.nl ([131.211.172.88] helo=ronja.ntg.nl) by ciao.gmane.org with esmtp (Exim 4.43) id 1Ev0RT-00023l-2L for gctc-ntg-context-518@m.gmane.org; Fri, 06 Jan 2006 23:52:19 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id D0C82127B4; Fri, 6 Jan 2006 23:52:14 +0100 (CET) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (smtp.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 09053-01; Fri, 6 Jan 2006 23:52:13 +0100 (CET) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id D185712803; Fri, 6 Jan 2006 22:25:51 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 2ED7712806 for ; Fri, 6 Jan 2006 22:25:50 +0100 (CET) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (smtp.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 07791-04-6 for ; Fri, 6 Jan 2006 22:25:48 +0100 (CET) Original-Received: from smtp-vbr17.xs4all.nl (smtp-vbr17.xs4all.nl [194.109.24.37]) by ronja.ntg.nl (Postfix) with SMTP id 4D302127C0 for ; Fri, 6 Jan 2006 22:25:42 +0100 (CET) Original-Received: from [192.168.0.193] (a80-126-172-1.adsl.xs4all.nl [80.126.172.1]) (authenticated bits=0) by smtp-vbr17.xs4all.nl (8.13.3/8.13.3) with ESMTP id k06LPaVC057034 for ; Fri, 6 Jan 2006 22:25:42 +0100 (CET) (envelope-from w.egger@boede.nl) User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923) X-Accept-Language: en-us, en Original-To: mailing list for ConTeXt users In-Reply-To: X-Virus-Scanned: by XS4ALL Virus Scanner X-Virus-Scanned: amavisd-new at ntg.nl X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.5 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: ntg-context-bounces@ntg.nl Errors-To: ntg-context-bounces@ntg.nl X-Virus-Scanned: amavisd-new at ntg.nl Xref: news.gmane.org gmane.comp.tex.context:25001 Archived-At: This is a multi-part message in MIME format. --------------040200080907050305080703 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable X-MIME-Autoconverted: from 8bit to quoted-printable by smtp-vbr17.xs4all.nl id k06LPaVC057034 Hi Hraban, Hans, Taco, I followed this thread with interest. By coincidence I was struggling=20 with this kind of problem during the last days. Thanks so much for this=20 educative example! In my case I have to fill in a table with the information concerning=20 parcels to be sent. Some times there is a single one sometimes there are=20 multiple pieces. For each of the parcels I have to fill in a table-row.=20 And voil=E0! 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 =20 > 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 =20 > place: > > \def\Sender#1#2#3{\setvalue{SenderKey#1}{#2}\setvalue{SenderVal#1}{#3}} > \def\GetSenderLine#1{\bTR\bTD\doiftextelse{\getvalue{SenderKey#1}} =20 > {\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=3Doff] > \setupTABLE[x][1][width=3D\senderkeywidth, align=3Dleft,=20 > style=3D{\keystyle \strut}] > \setupTABLE[x][2][width=3D\sendervalwidth, align=3Dright, style=3D=20 > {\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/=20 > Talk:Letter_style > > > > Gr=FC=DFlis 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 --------------040200080907050305080703 Content-Type: text/plain; name="infotable.tex" Content-Disposition: inline; filename="infotable.tex" Content-Transfer-Encoding: 7bit % Info-sheet for the parcel service % Context file % filename: infotable.tex % W.Egger % 06-01-2006 % Thanks to a thread on the Context mailinglist this works now! \environment layout \setupbodyfont[10pt] \setuppapersize[A4,landscape][A4,landscape] \setuplayout[ topspace=1.5cm, backspace=1.5cm, width=27cm] \setupheadertexts[\leftaligned{\bfd Parcel service info-sheet}] \def\Addressee#1#2#3#4#5#6#7#8{% \setvalue{Ordno#1}{#2}% \setvalue{Bestno#1}{#3}% \setvalue{Adres#1}{#4}% \setvalue{Dimension#1}{#5}% \setvalue{Weight#1}{#6}% \setvalue{Value#1}{#7}% \setvalue{Tel#1}{#8}} \def\Parcel#1{% \bTR% \bTD\getvalue{Ordno#1}% \doiftextelse{\getvalue{Bestno#1}}% {\blank[small]Ext. Orderno:\par\hfill\getvalue{Bestno#1}}{\strut\blank} \eTD% \bTD \getvalue{Adres#1} \eTD% \bTD \getvalue{Dimension#1} \eTD% \bTD \getvalue{Weight#1} \eTD% \bTD \getvalue{Value#1} \eTD% \bTD \getvalue{Tel#1} \eTD\eTR} \def\Numberofparcels{3} \starttext \Addressee{1}% {293-291}%Ordernumber {12345-2009}%External ordernumber {Maximilian Smallbody\\ Sunshinestreet 24\\ 3456 EE Natland\\ Cloudyland}%Addres {70 x 67 x 15 cm}%Dimension {7.5 kg}%Weight {1.000.00\euro}%Value {+31 455535251}%Phone \Addressee{2}% {293-292}%TC-nummer {}%External ordernumber {Milly Milltower\\ 3\high{rd} Duststreet\\ Millerstown 56789\\ Millersland}%Addres {120 x 12 x 12 cm}%Dimension {2.5 kg}%Gewicht {293.00\euro}%Waarde buiten EU {+99-9192939495}%Telefoon \Addressee{3}% {}% {}% {}% {}% {}% {}% {}% %= Do not edit below this line!= {\bfa Date: \date} \blank[1.5cm] \bTABLE \setupTABLE[row][first][style=bold,align=middle] \setupTABLE[column][each][width=.166\textwidth,align=right] \setupTABLE[x][3][align=middle] \setupTABLE[x][4][align=left] \setupTABLE[x][5][align=left] \bTR \bTD Ordernumber\eTD \bTD Address \eTD \bTD Dimension \eTD \bTD Weight \eTD \bTD Value \eTD \bTD Phone \eTD\eTR \dostepwiserecurse{1}{\Numberofparcels}{1}{% \expanded{\Parcel{\recurselevel}}} \eTABLE \stoptext --------------040200080907050305080703 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context --------------040200080907050305080703--