23 Jun
2022
23 Jun
'22
9:54 p.m.
Willi Egger via ntg-context schrieb am 23.06.2022 um 21:16:
Good evening gurus!
Why is the minimal example failing? i.e. executing always the else-branch?
\doifempty(else) doesn't expand the argument and any argument counts as not empty. To satisfy the command you can expand the first argument (\normalexpanded) or you use \doifnothing(else) which expands the argument. \starttext \startbuffer \doifemptyelse{}{YES}{NO} \doifemptyelse{\empty}{YES}{NO} \normalexpanded{\doifemptyelse{}}{YES}{NO} \normalexpanded{\doifemptyelse{\empty}}{YES}{NO} \doifnothingelse{}{YES}{NO} \doifnothingelse{\empty}{YES}{NO} \stopbuffer \typebuffer \getbuffer \stoptext Wolfgang