FOR iterator [AS typename] = start_param TO end_param STEP step_paramD.J.Peters wrote:if the FOR "counter" = "from" to "end" STEP "value" must be the same datatype !
- 'start_param', 'end_param' and 'step_param' can be of any type, of different types among themselves, and also of different types from the one of 'iterator' ('typename').
- The only constraint is that a 'typename' constructor (in case of local 'iterator') or a 'typename' assignment operator (in case of global 'iterator') matches with the passed 'start_param' argument, because the 'iterator' is implicitly constructed or assigned under the hood with 'start_param'.
- For the other arguments 'end_param' and 'step_param', they must be able to be converted into objects of the same type as the 'iterator'.
[edit]
The documentation seems to imply that these 3 arguments are of the same type as the iterator, perhaps because this is the most common use.
Maybe the documentation should be updated, or rather add a paragraph ("Advanced Usage") at the description end that mentions this less common usage.