Bill said:
I'm not sure how it is that I missed Debug.Assert when
I searched for an answer prior to my original post. With
me, you would have a better than even chance of winning
if you bet I'd ship a production before removing the "Stop
Method"...............
Bill
LOL.
I've actually seen production application where there were a bunch of
Debug.Print left behind. Not as nasty as a Stop or even Debug.Assert
which could introduce unwanted break, especially if the user isn't a
developer, but it does clutter up the immediate windows and add overhead
that isn't really needed.
There's also an alternative that isn't as common: compiler directives:
#Const Debug = 1 'We want the debug code to run.
Private Sub DoIt()
'Some code here...
#If Debug Then
Debug.Assert i = 5
#End If
'more code...
End Sub
All statements with leading # is actually an instruction to the
compiler, essentially telling it to only compile the statement
"Debug.Assert..." statement into the final output (which user will then
run) if and only if the Debug flag is set. (Can be named whatever, and
can be whatever values you like but I use it to illustrate).
Thus you get to keep all your debugging code intact and just set the
Debug to 0 when you're ready to ship. Sure beats chasing down every
stray Debug and Stops.