If you're like most of us, you're used to putting in numerous <FONT FACE=monospace>WAIT WINDOW</font> and <FONT FACE=monospace>? MYVAR</font> statements throughout your code to try to track down problems.<br><br>Now that we have a decent debug/trace ability in VFP, you can set breakpoints and <FONT FACE=monospace>SET STEP ON</font> in various places. But sometimes the problem occurs infrequently, and you hate stepping through hundreds of lines of code.<br><br>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.<br><br>And as an extra special bonus: raise your hand if you've ever accidently left debugging code (like a <FONT FACE=monospace>WAIT WINDOW</font>) in an application that went into production. I've done it dozens of times, and its darn embarrassing. Fortunately, if you issue the command <FONT FACE=monospace>SET ASSERTS OFF</font> then ASSERT statements aren't executed at runtime.<br><br>Note that ASSERTS are OFF by default, so you'll have to turn them on by issuing the command <FONT FACE=monospace>SET ASSERTS ON</font>.<br><br>Some examples of using Asserts:<br><br><FONT FACE=monospace>nConnHandle = sqlconnect('myconnection')<br>assert nConnHandle>0 message "connection failed"<br><br>select * from users where userid='FRED' into cursor curUsers<br>assert reccount('curUsers') > 0 message "no users found"<br></font> <p>Robert Bradley<br><a href=mailto: > </a><br><a href= - Visual FoxPro Development</a><br>