PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US

  • Reason
  • Correction
  • Example
  • Accessing a label declared in the code of a loop statement
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 42: Label out of scope of GOTO
Reason
A GOTO label is used in a FOR loop. However, the corresponding GOTO statement is not found in the FOR statement.
Correction
  • Include the GOTO statement and the corresponding label in the FOR statement.
  • Delete the label of GOTO statement from the FOR loop.
Example

Accessing a label declared in the code of a loop statement

Code triggering the error
I is int
MyArray is array of 10 int
...
GOTO WRITE2

FOR I = 1 to 10
MyArray[I] = 0

WRITE2:
MyArray[I-1]=I

END
Possible correction
Delete the label.
I is int
MyArray is array of 10 int
...

FOR I = 1 TO 10
        MyArray[I] = 0

        MyArray[I-1]=I

END
Minimum required version
  • Version 0
This page is also available for…
Comments
Click [Add] to post a comment