PC SOFT

WINDEVWEBDEV AND WINDEV MOBILE
ONLINE HELP

Home | Sign in | English UK

  • Reason
  • Tip
  • Example
  • Due to a typo error, a label is not used by any GOTO
Products
WINDEVWEBDEV - Server codeWEBDEV - Browser codeWINDEV MobileReports and Queries
Platforms
WindowsLinuxWindows MobileUniversal Windows 10 AppAndroidAndroid Widget iPhone/iPadApple Watch
Languages
JavaPHPAjaxUser code (UMC)External language
Databases
HFSQLHFSQL Client/ServerStored proceduresOLE DBODBCNative Accesses
Warning 12: The label is unused
Reason
This code line use the GOTO statement with branching labels. This label is defined in the current process but it is not used by any GOTO statement.
Tip
Check whether this label is really useless:
  • If the label is useless, delete it.
  • If the label is useful, correct the GOTO statement in order to use the proper label.
Example

Due to a typo error, a label is not used by any GOTO

Code triggering the error
Res = fOpen(FileName, foWrite)
IF Res = -1 THEN GOTO ERROPEN
Res = fWrite(Res, "Process OK")
IF Res = -1 THEN GOTO ERROPEN
...
RETURN

ERROPEN:
Info("The " + FileName + " file cannot be opened. Check its existence.")

ERRWRITE:
Info("Unable to write into " + FileName)
Possible corrections
Modify the code of the GOTO statement and replace the duplicate label by the corresponding label.
Res = fOpen(FileName, foWrite)
IF Res = -1 THEN GOTO ERROPEN
Res = fWrite(Res,"Process OK")
IF Res = -1 THEN GOTO ERRWRITE
...
RETURN

ERROPEN:
Info("The " + FileName + " file cannot be opened. Check its existence.")

ERRWRITE:
Info("Unable to write into " + FileName)
Minimum version required
  • Version 0
This page is also available for…
Comments
Click [Add] to post a comment