PC SOFT

WINDEVWEBDEV AND WINDEV MOBILE
ONLINE HELP

Home | Sign in | English UK
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.
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.
Component : wd240vm.dll
Minimum version required
  • Version 10
This page is also available for…
Comments
Click [Add] to post a comment