On 8/2/2021 8:54 PM, Benjamin Buchmuller via ntg-context wrote:
That's great, I wikified a Note for testing if a buffer exists or has content (using the \getbuffer[…] approach for the moment).
If I was asked, I'd opt for \doifelseemptybuffer (doifemptyelse?) since one could think of similar commands that test for empty "objects".
Is there an option for testing blocks? (I actually use blocks quite frequently …)
I just realized they are probably handled very differently during the typesetting. Basically I would just need to test if during the first run any of \beginBLOCK … \endBLOCK was invoked (but if one gets a test for some content in-between that's even better)
indeed, multiple axis ... so then we need three arguments instead of one for the test \defineblock[testa] \defineblock[testb] \starttext \begintesta oeps \endtesta \doifelseblocksempty {testa}{}{} {YES} {NOP} % {name}{tag}{criterium} \doifelseblocksempty {testb}{}{} {YES} {NOP} % {name}{tag}{criterium} \stoptext but you have to wikify it Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl -----------------------------------------------------------------