# [NTG-context] doifnextcharelse

Meer, Hans van der H.vanderMeer at uva.nl
Sun Jan 24 15:58:06 CET 2016

Yes this works. But alas, the ultimate goal is to test against several characters and that seems impossible to do with standard ConTeXt api-macros.Let alone when these characters are . or . or ) etc.

Hans van der Meer

met vriendelijke groet
Hans van der Meer

> On 24 Jan 2016, at 15:13, Pablo Rodriguez <oinos at gmx.es> wrote:
>
> On 01/24/2016 02:30 PM, dr. Hans van der Meer wrote:
>> I would like to differentiate on the following character being one of  X or not X.
>> But cannot get it right in \doifnextcharelse.
>>
>> For example
>> \def\mynextchar{\doifnextcharelse{X}{\def\Next{Y}}{\def\Next{Z}}\Next} delivers: ZX ZQ
>> then input: \mynextchar X \mynextchar Q
>> I hoped for YX ZQ, but it looks as if X tested false against X.
>>
>> How to?
>
> Hans,
>
> the basic \def\mynextchar{\doifnextcharelse{x}{y}{z}} works.
>
>
>    \def\mynextchar{
>        \doifnextcharelse{X}
>        {\def\Next{Y}\Next}
>        {\def\Next{Z}\Next}}
>
> I hope it helps,
>
>
> Pablo
> --
> http://www.ousia.tk