PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
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
Used to find out and signal the possible errors via an assertive programming. dbgAssert is used in a code where a possible error may occur. A window signals the problem if an error occurs.
This mode is used by default in test mode and it can be enabled at run time by dbgEnableAssert.
Versions 15 and later
Java This function is now available for the Java applications.
New in version 15
Java This function is now available for the Java applications.
Java This function is now available for the Java applications.
Versions 18 and later
Universal Windows 10 App This function is now available in Windows Store apps mode.
New in version 18
Universal Windows 10 App This function is now available in Windows Store apps mode.
Universal Windows 10 App This function is now available in Windows Store apps mode.
Versions 19 and later
iPhone/iPad This function is now available for the iPhone/iPad applications.
Android This function is now available for the Android applications.
New in version 19
iPhone/iPad This function is now available for the iPhone/iPad applications.
Android This function is now available for the Android applications.
iPhone/iPad This function is now available for the iPhone/iPad applications.
Android This function is now available for the Android applications.
Versions 21 and later
Apple Watch This function is now available in Apple Watch mode.
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
New in version 21
Apple Watch This function is now available in Apple Watch mode.
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
Apple Watch This function is now available in Apple Watch mode.
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
Example
// The procedure named FindCustomer(Number) is used to find the specified customer
PROCÉDURE FindCustomer(Number)
HReadSeekFirst(CUSTOMER, Number, Number)
dbgAssert(HFound, "Customer not found")
// SoughtValue was passed in parameter, it should exist in the file.
// Position on the record
HReadSeekFirst(FileName, ItemName, SoughtValue)
// Check whether a record was found
// (in all cases, "standard" or "debug" mode)
IF HFound(FileName) = False THEN
// In "debug" mode, display a message to indicate that a problem occurred
dbgAssert(False, StringBuild("The %1 record of" + ...
"FileName was not found", SoughtValue))
// Manage this case in the code by creating a record if it was not found
HReset(FileName)
FileName.ItemName = SoughtValue
HAdd(FileName)
END
Syntax
dbgAssert(<Condition to Check> [, <Comment>])
<Condition to Check>: Character string (with or without quotes)
Condition whose test must be run. This condition can be a WLanguage function, a local or global procedure, an expression, ...
<Comment>: Optional character string
Text that will be displayed (in a window) if the condition is not checked.
Remarks
  • In test mode, the management of assertions is enabled by default.
  • At run time, the management of assertions is disabled by default. dbgAssert is not run. The WLanguage function specified in parameter will not be run.
  • There is no need to use InTestMode when the management of assertions is enabled. Indeed, this function was used to trace a specific operating mode but this operation can now be done by dbgAssert.
  • WEBDEV - Server code When this function is used in an AWP page, assertions are not displayed.
    Indeed, the execution of the pages in AWP mode is performed by the Web server, and the Web server cannot create interfaces.
  • Versions 22 and later
    Android The messages of dbgAssert will be written into the ADB log (at "Assert" level). See Managing ADB logs for more details.
    New in version 22
    Android The messages of dbgAssert will be written into the ADB log (at "Assert" level). See Managing ADB logs for more details.
    Android The messages of dbgAssert will be written into the ADB log (at "Assert" level). See Managing ADB logs for more details.
Components
WINDEVWEBDEV - Server codeReports and Queries wd230vm.dll
Windows Mobile wp230vm.dll
Java wd230java.jar
Linux wd230vm.so
Android wd230android.jar
Minimum required version
  • Version 10
This page is also available for…
Comments
Click [Add] to post a comment