PC SOFT

WINDEVWEBDEV AND WINDEV MOBILE
ONLINE HELP

Home | Sign in | English UK

  • Reason
  • Correction
  • Examples
  • Using a conditional statement without END
  • Nested conditional statements
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
Error 28: No END statement is associated with this SWITCH
Reason
You are using a conditional statement (SWITCH). The END keyword must be used to end this statement.
Correction
We recommend that you pay special attention to the exception process. Indeed, no error occurring in the exception process can be intercepted.
Examples

Using a conditional statement without END

Code triggering the error
SWITCH EDT_Quantity
CASE 1: STC_Comment = "Benefit from our promotions: buy one, get one free"
CASE 2: STC_Comment = "Buy one product, get one free"
Possible correction
Use the END keyword to specify that the conditional condition is ended.
SWITCH EDT_Quantity
CASE 1: STC_Comment = "Benefit from our promotions: buy one, get one free"
CASE 2: STC_Comment = "Buy one product, get one free"
END

Nested conditional statements

Code triggering the error
SWITCH EDT_Quantity
CASE 1: STC_Comment = "Benefit from our promotions: buy one, get one free"
CASE 2: STC_Comment = "Buy one product, get one free"
IF EDT_Quantity > 5 THEN
STC_Comment = ""
END
Possible correction
Check whether all the nested statements are properly ended (with the END statement for example). In our example, the second IF statement has no associated END. Add an END statement.
SWITCH EDT_Quantity
CASE 1: STC_Comment = "Benefit from our promotions: buy one, get one free"
CASE 2: STC_Comment = "Buy one product, get one free"
IF EDT_Quantity > 5 THEN
STC_Comment = ""
END
END
Minimum version required
  • Version 0
This page is also available for…
Comments
Click [Add] to post a comment