Error, controlling variable of for loop must be a name
|
Description
|
|
The for name clause specifies the for loop's control variable. The name may be any expression for which the type(expr, name) command returns a value of true.
This error message occurs when the control variable used in the for loop is not of type name, that is, expressions for which the type(expr, name) command returns a value of false.
|
|
Examples
|
|
Example 1
In this case, the control variable has been omitted.
>
|
|
Solution:
The name has been designated as the control variable.
>
|
|
| (2.1) |
Example 2
This error occurs because the specified controlling variable is not a name.
>
|
|
>
|
|
>
|
|
| (2.2) |
Solution:
Replace with an expression for which type(expr, name) returns true. For example, replacing with corrects the error.
>
|
|
>
|
|
| (2.3) |
|
|
Download Help Document
Was this information helpful?