I have a bunch of tokens with default values. I need to test each of these and print a message in case they are still the default value. I am able to do this manually as shown below. Now when I attempt to write a macro for this I run into problems. I want to be able to report the name of the token that was not set so attempted to pass in the name of the token and use \the\#1 to get the value. I am thinking there is someting basic I am missing and have tried a bunch of things but still am not able to make this work. Any ideas?
\documentclass[12pt]{article}
\usepackage{ifthen}
\newtoks{\MyParameter}
\MyParameter={X} % Set default value
\newcommand{\TestIfGivenValue}[2]{%
\ifthenelse{\equal{\the\#1}{#2}}{%
\warningbox{B: Please set the value of $backslash$#1}%
}{%
B: Yes, the \textbackslash MyParameter has a non default value.
}}
\begin{document}
% Manual method: works great
\ifthenelse{\equal{\the\MyParameter}{X}}{%
A: Please set the value of \textbackslash MyParameter \\%
}{
A: Yes, the \textbackslash MyParameter has a non default value.
}
% Now attempt to wrap this in a new command
\TestIfGivenValue{MyParameter}{X}
\end{document}