PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US

  • Reason
  • Correction
  • Examples
  • Using a FOR statement without END
  • Nested statements: a FOR statement and an IF statement are nested
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 22: No END statement is associated with this FOR
Reason
You are using a loop statement (FOR). This statement must end with the END keyword.
Correction
Check the code of your loop statement and add the END keyword if necessary.
Examples

Using a FOR statement without END

Code triggering the error
FOR I = 1 TO 10
        MyArray[I] = MyVariable + 10
Possible correction
Add the END keyword at the end of the loop.
FOR I = 1 TO 10
        MyArray[I] = MyVariable + 10
END

Nested statements: a FOR statement and an IF statement are nested

Code triggering the error
FOR I = 1 TO TABLE_TABLE1..Occurrence
IF COL_SOFTWARE[I] = "WEBDEV" THEN
TABLE_TABLE1[I][2]..BrushColor = LightBlue
TABLE_TABLE1[I][2]..Color = iLightYellow
END
Possible correction
Check whether all the nested statements are properly ended (with the END statement for example). In our example, the IF statement has no associated END statement. Add an END statement.
FOR I = 1 TO TABLE_TABLE1..Occurrence
IF COL_SOFTWARE[I] = "WEBDEV" THEN
TABLE_TABLE1[I][2]..BrushColor = LightBlue
TABLE_TABLE1[I][2]..Color = iLightYellow
END
END
Minimum required version
  • Version 0
This page is also available for…
Comments
Click [Add] to post a comment