Am 03.08.2012 um 21:12 schrieb Daniel Schopper <[email protected]>:
> Hi,
> \checkparameters seems broken in the current beta. The following example used
> to work at least with version 2012.06.13
>
> ---------------------------------------------------------------------------------
> \def\myCom[#1]{%
> \checkparameters[#1]
> \ifparameters
> \getparameters[do][one=1,two=2,#1]
> \doone\ \dotwo
> \else
> #1
> \fi
> }
> \starttext
> \myCom[one]
>
> \myCom[one=one,two=two]
> \stoptext
You have to change this on syst-aux.mkiv:
\unexpanded\def\checkparameters[#1]%
- {\syst_helpers_get_empty_parameters#1=@@\_e_o_s_}
+ {\syst_helpers_check_parameters#1=@@\_e_o_s_}
You can also use \doifassignmentelse to check the content of your macro.
\def\mycommand[#1]%
{\doifassignmentelse{#1}
{\getrawparameters[mycommand][one=1,two=2,#1]%
\mycommandone\ \mycommandtwo}
{#1}}
When you want to use \if… \else … \fi in your command you can use this:
\def\mycommand[#1]%
{\doifassignmentelse{#1}\donetrue\donefalse
\ifdone
\getrawparameters[mycommand][one=1,two=2,#1]%
\mycommandone\ \mycommandtwo
\else
#1%
\fi}
Wolfgang
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the
Wiki!
maillist : [email protected] / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage : http://www.pragma-ade.nl / http://tex.aanhet.net
archive : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___________________________________________________________________________________