This:

\defineblock[question]
\defineblock[answer]

\defineenumeration[question][text={Question}]
\defineenumeration[answer]  [text={Answer}]

\keepblocks[question]
\hideblocks[answer]


\def\mynewcommand{\dosingleempty\doMyNewCommand}
\def\doMyNewCommand[#1]#2{%
 \iffirstargument
     \beginquestion
       \startquestion #2%
       \stopquestion
     \endquestion
       \beginanswer \startanswer #1%
       \stopanswer \endanswer
 \else
     \beginquestion
       \startquestion #2%
       \stopquestion
     \endquestion
       \incrementcounter[answer]
 \fi
}


\starttext

\chapter{Question}

\beginquestion
        \startquestion
                Question 1.
        \stopquestion
\endquestion

\beginanswer
        \startanswer
                Answer 1.
        \stopanswer
\endanswer

\beginquestion
        \startquestion
                Question 2.
        \stopquestion
\endquestion

\beginanswer
        \incrementcounter[answer]
\endanswer

\beginquestion
        \startquestion
                Question 3.
        \stopquestion
\endquestion

\beginanswer
        \startanswer
                Answer 3.
        \stopanswer
\endanswer

\mynewcommand{Question 5}

\mynewcommand[Resposta 6]{Question 6}

\chapter{Answers}

\useblocks[answer]

\stoptext

does not work
___________________________________________________________________________________
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

Reply via email to