ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / Errors / WLanguage errors
  • Reason
  • Correction
  • Example
  • Using a loop statement with a variable step to initialize an array
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 19: The step of this FOR loop must be constant
Reason
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.
Correction
Modify the STEP of your loop statement.
Example

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

Last update: 05/26/2022

Send a report | Local help