0

This is my primative code:

\documentclass{article}
\usepackage{xstring}
\usepackage{ifthen}
\usepackage{pgfkeys}

\newcommand{\setvalue}[1]{\pgfkeys{/variables, #1}}
\newcommand{\getvalue}[1]{\pgfkeysvalueof{/variables/#1}}
\newcommand{\declare}[1]{%
 \pgfkeys{
  /variables/#1.is family,
  /variables/#1.unknown/.style = {\pgfkeyscurrentpath/\pgfkeyscurrentname/.initial = ##1}
 }%
}   
\declare{}
\begin{document}
\setvalue{varL = \StrLen{Hellow}}
\newcounter{loop}
\forloop{loop}{1}{\value{loop}< \protect\getvalue{varL}}{{\arabic{loop}}}
\end{document}

This is just the start of my bigger macro, but LaTeX does not like this command:

\value{loop}< \protect\getvalue{varL}

I need to send to \fooloop macro length of the word, which is changeable.

How I can solve the problem?

Thank you in advanced.

1
  • \getvalue{varL} is also integer or not? So why It should not work?
    – saldenisov
    Feb 11 '14 at 22:01
1

Code should be changed like this:

\begin{document}
\StrLen{Hellow}[\varL]
\newcounter{loop}
\forloop{loop}{1}{\value{loop}< \protect\getvalue{varL}}{{\arabic{loop}}}
\end{document}

Then it will work.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.