PDR4005W

Section, Line number, Column number: The FOR loop NEXT variable varname does not match the loop counter variable varname.

What happened: You specified a variable in the terminating NEXT variable clause for a FOR loop that did not match the loop counter variable.

What to do: Either change the NEXT variable to match the FOR loop counter variable or omit the NEXT variable, which is optional anyway.