|
|
|
|
- Reason
- Correction
- Examples
- Using an integer in the counter of the loop and a real in the STEP of the loop
Error 20: The variable of the FOR loop should be a real
You are using a loop statement (FOR). In this statement, you are using an integer variable for the counter of the loop and a real value for the value of STEP. Standardize the types used in the counter of the loop and in the STEP of the loop. The same type must be used. Using an integer in the counter of the loop and a real in the STEP of the loop Code triggering the error I is int FOR I=1 TO 10 STEP 0.4 IF COL_Software[I]=2 THEN TABLE_TABLE1[I][2].BackgroundColor = LightBlue END END
Possible correction Use the integer type for STEP. In this example, the repetition will not be performed: the calculation performed for the first value of the loop will be: 1 + 0,4 = 1,4. The value 1.4 is rounded to 1. The loop always remains to 1. I is int FOR I=1 TO 10 STEP 1 IF COL_Software[I]=2 THEN TABLE_TABLE[I][2].BackgroundColor = LightBlue END END
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|