You don't need to define it in a loop. You can define it outside the loop and just add the other variables to the input argument list.
Do you have
by itself, in the loop, with no semicolon and nothing else on that line? If so, that would cause it to say what it was.