PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US

  • Reason
  • Correction
  • Example
  • Using the BREAK keyword to interrupt a procedure
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 34: 'Break' is not allowed outside the loops
Reason
The BREAK keyword was used to interrupt a procedure.
Reminder: The BREAK keyword must only be used to interrupt a loop.
Correction
To exit from a procedure, use RETURN or RESULT (if a value must be returned to the calling process).
Example

Using the BREAK keyword to interrupt a procedure

Code triggering the error
PROCEDURE Compare(Number1, Number2)
IF Number1 > Number2 THEN
        Info(Number1 + "is greater than" + Number2)
        BREAK
END
Possible correction
The BREAK keyword must be replaced by the RETURN keyword.
PROCEDURE Compare(Number1, Number2)
IF Number1 > Number2 THEN
        Info(Number1 + "is greater than" + Number2)
        RETURN
END
Minimum required version
  • Version 0
This page is also available for…
Comments
Click [Add] to post a comment