[Tex/LaTex] LaTeX algorithmic package: Undefined Control Sequence in for-Loop

algorithmserrorsloopsmacros

I'm trying to specify an algorithm in pseudocode in a LaTeX document, but I'm having trouble with the for-Loop. My statement:

\for{$bin=0 to binCount$}
\item blablabla
\endfor

keeps on generating the error "Undefined Control Sequence". I also tried the usual for-notation (bin=0;bin<binCount;bin++).
I have not defined any of the variables before, nor do I want to do that; I just want LaTeX to print exactly what I'm writing in an algorithm layout.

Is there a way to "switch off" this sort of code interpretation? What exactly am I doing wrong?

Add'l information: I have stated bot the algortihm and algorithm environment. Without this for-Loop, it generates the document without any errors. The \item statement is just a filler.

Best Answer

Command names in LaTeX are case sensitive:

\FOR{$\mathit{bin}=0$ to $\mathit{binCount}$}
...
\ENDFOR

is what the documentation says (I added the \mathit around the multiletter variables, that renders better than writing $binCount$).