|
|
|
|
- Reason
- Correction
- Example
- Using a loop statement with a variable step to initialize an array
Error 19: The step of this FOR loop must be constant
This line of code uses a loop statement (FOR). The STEP of this loop statement is likely to change at each iteration. Remark: Only the loops based on a local variable (integer or real) accept a variable step. Modify the STEP of your loop statement. Using a loop statement with a variable step to initialize an array Code triggering the error J is int = 0 I is int = 0 MyArray is array of 5 int FOR I = 1 TO 5 STEP J+1 MyArray[I] = I END
Possible correction Use a fixed step. J is int = 0 I is int = 0 MyArray is array of 5 int FOR I = 1 TO 5 STEP J MyArray[I] = I END
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|