UndefVarError in for loop

@jlperla Thanks for your reply. What does the $ really do be before the variables?