I need the value of a variable, set in ifeqcase, outside of ifeqcase. For example this code doesn't work
\documentclass[12pt]{article}
\usepackage{fontspec}
\usepackage{xunicode}
\usepackage{geometry}
\usepackage{calculator,calculus}
\usepackage{multido}
\usepackage{xstring}
\usepackage[fontsize=22pt]{scrextend}
\setmainfont{Latin Modern Sans Quotation}
\geometry{papersize{30cm,19.35cm},left=1cm,right=1cm,top=1cm,bottom=1cm}
\pagestyle{empty}
\newcommand{\valeurcal}[2]{
\SUBTRACT{1}{\ra}{\partiell}
\MULTIPLY{\partiell}{#1}{\partielll}
\MULTIPLY{\ra}{#2}{\partiell}
\ADD{\partiell}{\partielll}{\leresultat}
}
\begin{document}
\multido{\ra=0.0+0.2}{1}{
\valeurcal{0}{5}
\ROUND[0]{\leresultat}{\coupe}
\IfEqCase{\coupe}{%
{1}{ \COPY{5}{\nouvcoupe}}% test with calculator
{2}{ \def\nouvcoupe{6}}}% test with def, edef and gdef (thank for the answer)
value of nouvcoupe : \nouvcoupe}
\end{document}
give me : Undefined control sequence. (compiled with xelatex)
The probleme seems to come with \valeurcal{0}{5}. If I replace \valeurcal{0}{5} by \COPY{2}{\leresultat} I can compile it (but it don't do the job)!
\valeurcal{0}{5} calculate 0*(1-\ra)+5*\ra where \ra
What do you advise to me?
Thank you in advance.