\documentclass[a4paper]{article}
\usepackage{comment}
\usepackage[trim]{tokenizer}
\usepackage{ifthen}
\usepackage{xargs}
\usepackage{xkeyval}
\usepackage{xfor}
\begin{document}
\makeatletter
\def\bb{\compilation} % \combilation has {one,two,three}
\newcommand{\chapterInputa}[4][all
]{%
% It does not work
\def\SourceA{\bb}
\whiledo{\not\equal{\SourceA}{}}
{
\GetTokens{TokenOneA}{TokenTwoB}{\SourceA}
BB TOken- \TokenOneA \\
\let\SourceA\TokenTwoB
}
% its work fine
\def\Source{#1}
\whiledo{\not\equal{\Source}{}}
{
\GetTokens{TokenOne}{TokenTwo}{\Source}
ELE- \TokenOne \\
\let\Source\TokenTwo
}
\chapter{#3\label{#4}}
\input{#2}
}
}
\makeatother
\end{document}
The change in two code is passing parameter as #1
and variable name.
What's wrong with the code.
\documentclass
and shows all packages used. As posted it uses several non standard commands with no indication of where or how they are defined, so there is not much help we can offer.\whiledo
\SourceA
is expanded to\bb
first. Then\bb
is expanded to\compilation
, but the latter is undefined.! Too many }'s. l.45 }
If the spurious}
is deleted then the example runs without error. However it doesn't use any of the macros it defines and you haven't said what you intend those macros to do so it is still impossible to guess what help you are looking for.