[NTG-context] Failing \doifemptyelse
Willi Egger
context at boede.nl
Fri Jun 24 13:59:26 CEST 2022
Hans, Wolfgang!
Thank you so much for your instructions! — This expansion thing is something I will probably never master ;-(
Thank you!
Kind regards
Willi
> On 24 Jun 2022, at 05:42, Wolfgang Schuster via ntg-context <ntg-context at ntg.nl> wrote:
>
> Hans Hagen via ntg-context schrieb am 23.06.2022 um 23:00:
>> On 6/23/2022 9:16 PM, Willi Egger via ntg-context wrote:
>>> Good evening gurus!
>>>
>>> Why is the minimal example failing? i.e. executing always the else-branch?
>>>
>>> \setuppapersize[A6][A6]
>>>
>>> \setvariables
>>> [Test]
>>> [Number=]
>>>
>>>
>>> \starttext
>>> Value of variable Number before test: \getvariable{Test}{Number} \crlf
>>>
>>> \doifemptyelse{\getvariable{Test}{Number}}
>>> {\dorecurse
>>> {5}
>>> {TEST}
>>> }
>>> {Nothing defined \par
>>> Contents of variable Number: \getvariable{Test}{Number}
>>> }
>>>
>>> \stoptex
>> there's also
>>
>> \doifelsevariable {Test} {Number}
>>
>> that can be used
>
> in this case
>
> \doifelseemptyvariable{Test}{Number}{...}{...}
>
> is the better choice
>
> Wolfgang
>
> ___________________________________________________________________________________
> If your question is of interest to others as well, please add an entry to the Wiki!
>
> maillist : ntg-context at ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage : http://www.pragma-ade.nl / http://context.aanhet.net
> archive : https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
> ___________________________________________________________________________________
More information about the ntg-context
mailing list