ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / Errors / WLanguage errors
  • 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/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
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
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 05/26/2022

Send a report | Local help