Peter Münster schrieb:

On Sun, 8 Feb 2009, Alan Stone wrote:

Re: http://wiki.contextgarden.net/System_Macros/Branches_and_Decisions

What kind of emptyness do \doifempty, \doifnotempty, \doifemptyelse test ?

Hello Alan,

Here a small test file:

\def\Empty{}
\def\Macro#1{argument is \doifemptyelse{#1}{empty}{full}}
\starttext
\quotation{Remember to expand it yourself where needed.}

\Macro{}, \Macro{blabla}

Nothing: \doifemptyelse{}{empty}{full}

\type{\Empty}: \doifemptyelse{\Empty}{empty}{full}

\type{all expanded}: \expanded{\doifemptyelse{\Empty}{empty}{full}}

\type{with \expandafter}:
\expandafter\doifemptyelse\expandafter{\Empty}{empty}{full}

You can use ConTeXt's \ExpandAfter:

\ExpandAfter\doifemptyelse{\Empty}{empty}{full}

\stoptext

@Alan: It's better to use \doifsomething / \doifelsenothing because
they work also with macro content.

Wolfgang
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

Reply via email to