You must use a logical expression with a FOR or WHILE clause (Error 1127)

A FOR or WHILE clause within a command does not contain a logical expression. For more information, see Creating Logical Expressions.