[NTG-context] parsing multi-valued parameters

Werner Hennrich wehe at gmx.at
Fri Feb 12 09:11:27 CET 2021


ahhhh, so easy - thank you Hans!
cheers, Werner

Am 12.02.21 um 09:01 schrieb Hans Hagen:
> On 2/12/2021 8:26 AM, Werner Hennrich wrote:
>> Hello everyone,
>>
>> please can you give me pointers on how to easiest parse multi-valued
>> \dummyparameter{...} like in
>>
>> \something[...,weather={sunshine, rain, hail},...]
>>
>> so that I can test for e.g.  rain, sunshine, wind, hail, mist, fog,
>> storm etc, each if it is present or not?
>>
>> ...so I can keep my number of parameters down and my parameter list as
>> simple as possible.
>>
>> I have no idea what to search for in the docs or (better) in the test
>> cases / samples.
>> Would be great if you could just let me know where to look or what to
>> sarch for
> \setvariables[mynamespace][a=1,b=2,c={3,4,5}]
>
> \doifelseinset{4}{\getvariable{mynamespace}{c}}{FOUR}{OEPS}
>
> \setvariables[mynamespace][d={one,two,three,four}]
>
> \doifelseinset{4}{\getvariable{mynamespace}{c}}{FOUR}{OEPS}
>
> \doifelseinset{two}{\getvariable{mynamespace}{d}}{y}{n}
>
> of course when you need millions of (similar) checks you might go for
> another approach but this is still doable (0.02 sec per 10K on my
> machien so less on yours)
>
> Hans
>
>
> -----------------------------------------------------------------
>                                           Hans Hagen | PRAGMA ADE
>               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
>        tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
> -----------------------------------------------------------------




More information about the ntg-context mailing list