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