PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US

  • 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/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
Error 19: The step of this FOR loop must be constant
Reason
This code line uses a loop statement (FOR). The STEP of this loop statement is likely to change at each iteration.
Note: 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
Minimum required version
  • Version 0
This page is also available for…
Comments
Click [Add] to post a comment