Hello, a question - I'm just curious: What is advantage (or maybe intension) of using buffers over \def? Compare: ---- \def\BufA{This is buffer A.} \startbuffer[BufB] This is buffer B. \stopbuffer \starttext \BufA \getbuffer[BufB] \ifx\BufC\undefined No buffer C.\else\BufC\fi \stoptext ---- Both ways give the required effect. Moreover, when using \def, I can also test its existence (maybe it's also possible with buffers, but I don't know how). Best regards, Lukas -- Ing. Lukáš Procházka [mailto:LPr@pontex.cz] Pontex s. r. o. [mailto:pontex@pontex.cz] [http://www.pontex.cz] Bezová 1658 147 14 Praha 4 Tel: +420 244 062 238 Fax: +420 244 461 038
On 18-4-2012 11:48, Procházka Lukáš Ing. - Pontex s. r. o. wrote:
Hello,
a question - I'm just curious:
What is advantage (or maybe intension) of using buffers over \def?
better test with \startlines test test \stoplines also, bufferes can be flushed verbatim, as tex, as ... while macros are sort of frozen. Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
Am 18.04.2012 um 11:48 schrieb Procházka Lukáš Ing. - Pontex s. r. o.:
Hello,
a question - I'm just curious:
What is advantage (or maybe intension) of using buffers over \def?
Compare:
---- \def\BufA{This is buffer A.}
\startbuffer[BufB] This is buffer B. \stopbuffer
\starttext \BufA \getbuffer[BufB]
\ifx\BufC\undefined No buffer C.\else\BufC\fi
\ifdefined\BufC … \else … \fi Sometimes \setvariables is a better method to store texts in a document.
\stoptext ----
Both ways give the required effect.
Moreover, when using \def, I can also test its existence (maybe it's also possible with buffers, but I don't know how).
You can use \doifelsebuffer{<buffer name>}{…}{…}. Wolfgang
participants (3)
-
Hans Hagen
-
Procházka Lukáš Ing. - Pontex s. r. o.
-
Wolfgang Schuster