From: Wolfgang Schuster <wolfgang.schuster.lists@gmail.com>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: parsing multi-valued parameters
Date: Fri, 12 Feb 2021 12:53:53 +0100 [thread overview]
Message-ID: <31ffd7c3-a12e-149d-d223-ac41b1264cc5@gmail.com> (raw)
In-Reply-To: <b994730c-472c-f770-4f3f-4ba474ec9d2f@gmx.at>
Werner Hennrich schrieb am 12.02.2021 um 08:26:
> 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
\starttext
\def\something[#1]%
{\getdummyparameters[weather=,#1]%
\processallactionsinset
[\dummyparameter{weather}]
[sunshine=>Sunshine\endgraf,
rain=>Rain\endgraf,
hail=>Hail\endgraf]}
\something[weather=sunshine]
\blank
\something[weather={sunshine,rain}]
\stoptext
Wolfgang
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@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
___________________________________________________________________________________
next prev parent reply other threads:[~2021-02-12 11:53 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-12 7:26 Werner Hennrich
2021-02-12 7:37 ` Henning Hraban Ramm
2021-02-12 8:01 ` Hans Hagen
2021-02-12 8:11 ` Werner Hennrich
2021-02-12 11:53 ` Wolfgang Schuster [this message]
2021-02-13 18:44 ` Werner Hennrich
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=31ffd7c3-a12e-149d-d223-ac41b1264cc5@gmail.com \
--to=wolfgang.schuster.lists@gmail.com \
--cc=ntg-context@ntg.nl \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).