ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / Errors / WLanguage errors
  • Reason
  • Correction
  • Examples
  • Using an integer in the counter of the loop and a real in the STEP of the loop
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
Error 20: The variable of the FOR loop should be a real
Reason
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.
Correction
Standardize the types used in the counter of the loop and in the STEP of the loop. The same type must be used.
Examples

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…
Comments
Click [Add] to post a comment

Last update: 05/26/2022

Send a report | Local help