ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* URGENT question
@ 2000-11-14 13:33 Dan Seracu
  2000-11-14 14:11 ` Hans Hagen
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Seracu @ 2000-11-14 13:33 UTC (permalink / raw)


    Hello!

I'm trying to automate a document production: I want to typeset two
different tables from the same source, so I imagine something like this:

\def\ITEM#1#2 {\bTR \bTD #1 \eTD \bTD #2 \eTD \eTR
\immediate\write\auxfile{\string\NITEM{#1}{#2}}}

\def\NITEM#1#2{\bTABLE \bTR \bTD #1 \eTD \bTD #2 \eTD \eTR \eTABLE}

\immediate\openou\auxfile = iii.ttt

\bTABLE
\ITEM {asda} {aadasda}
\ITEM {adasd} {adfafsd}
\eTABLE

\immediate\closeout\auxfile

\input iii.ttt

This code generates an interesting error missing \endcsname ..??...
How can I do this thing??

Dan Seracu


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: URGENT question
  2000-11-14 13:33 URGENT question Dan Seracu
@ 2000-11-14 14:11 ` Hans Hagen
  0 siblings, 0 replies; 2+ messages in thread
From: Hans Hagen @ 2000-11-14 14:11 UTC (permalink / raw)
  Cc: ntg-context

At 03:33 PM 11/14/00 +0200, you wrote:
>
>    Hello!
>
>I'm trying to automate a document production: I want to typeset two
>different tables from the same source, so I imagine something like this:
>
>
>\def\ITEM#1#2 {\bTR \bTD #1 \eTD \bTD #2 \eTD \eTR
>\immediate\write\auxfile{\string\NITEM{#1}{#2}}}
>
>\def\NITEM#1#2{\bTABLE \bTR \bTD #1 \eTD \bTD #2 \eTD \eTR \eTABLE}
>

you need to allocate a file slot 

\newwrite\auxfile 

[btw, context provides: \scratchwrite and \scratchread]

>\immediate\openou\auxfile = iii.ttt

                  ^t
>
>\bTABLE
>\ITEM {asda} {aadasda}
>\ITEM {adasd} {adfafsd}
>\eTABLE
>
>\immediate\closeout\auxfile
>
>\input iii.ttt
>
>This code generates an interesting error missing \endcsname ..??...
>How can I do this thing??

\'a la ConTeXt: 

\starttext

\startbuffer[again]
\ITEM {asda} {aadasda}
\ITEM {adasd} {adfafsd}
\stopbuffer

\def\ITEM#1#2{\bTR \bTD #1 \eTD \bTD #2 \eTD \eTR}

\bTABLE
\getbuffer[again]
\eTABLE

\def\ITEM#1#2{\bTABLE \bTR \bTD #1 \eTD \bTD #2 \eTD \eTR \eTABLE}

\getbuffer[again]

\stoptext

-------------------------------------------------------------------------
                                                  Hans Hagen | PRAGMA ADE
                      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
-------------------------------------------------------------------------


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2000-11-14 14:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-11-14 13:33 URGENT question Dan Seracu
2000-11-14 14:11 ` Hans Hagen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).