How to include Assertion Checking? #include and compiling ──────────────────────────────────────────────────────────────────────────────
To take advantage of MrDebug's assertion facilities the first thing you must do is include the MrDebug.CH header file within each source code module that you wish to place an assert command in.
Among other things, MrDebug.CH contains the directives for all of MrDebug's assertion commands
If you simply want to trace all of the functions that are called, there is no need to include MrDebug.Ch or define the MRDEBUG token to the compiler. You can simply toggle the Function Trace Messages and run your program.
If you are going to take advantage of MrDebug's Assertion checking command then you'll need to include in each module that you are going to use Assertion checking in, a #INCLUDE "MrDebug.ch" line and each module should be compiled with an identifier such as /dMRDEBUG.
Once you have finished testing and you are ready to send out the final version of your program, there is no need to leave all of this assertion checking in your final application - if your testers have done their job and they have run each and every part of your system and all assertions have been successful - there is no need to have this code in.
If you do wish to use Assertion Checking within your runtime modules then you can link in MrAssert.obj, our run-time Assertion library.
Besides, if the system does fall over at a later stage, MrDump will be in your error system and this will give you enough information to track the problem down.
If you define a compile time variable called MRD_NO_CASE, any IF...ELSE...ENDIF constructs will not be preprocessed into DO...CASE...ENDCASEstatements - the default behaviour for Clipper. This will allow you to step through a problem that you might have within an IF...ELSE...ENDIF structure.
To remove all assertion checking from you application simply remove the compiler token /dMRDEBUG from the make script or compile line and all assertions will be removed without forcing you to make any changes to your source code.