If you're like most of us, you're used to putting in numerous [tt]WAIT WINDOW[/tt] and [tt]? MYVAR[/tt] statements throughout your code to try to track down problems.
Now that we have a decent debug/trace ability in VFP, you can set breakpoints and [tt]SET STEP ON[/tt] in various places. But sometimes the problem occurs infrequently, and you hate stepping through hundreds of lines of code.
Enter ASSERT. An ASSERT allows you to test an expression at runtime, and only notify you if the expression evaluates to false. As a bonus, it not only notifies you, but allows you to invoke the debugger at that point.
And as an extra special bonus: raise your hand if you've ever accidently left debugging code (like a WAIT WINDOW) in an application that went into production. I've done it dozens of times, and its darn embarrassing. Fortunately, if you issue the command [tt]SET ASSERTS OFF[/tt] then ASSERT statements aren't executed at runtime.
Note that ASSERTS are OFF by default, so you'll have to turn them on by issuing the command SET ASSERTS ON.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.