>---------------------------
>I'm puzzled by something happening in my VFP 5 debugger.
>Under Debug the last menuitem is
>Set Next Statement
>Sometimes it's available and sometimes it's grayed out.
>
>I've used it before and lately I'm fustrated because it's now spending most of it's time grayed out and I don't understand why.
>
>What are the rules about when this is available?
I'll assume it was the same in VFP 5 as it is today. SET NEXT STATEMENT is available only with the currently executing code module. Unfortunately you can't branch to a different one.
Make sure that every function, procedure, method has a RETURN statement, if it's just returning .T. Add the following code snippet at the end of your error handler to give you more control over debugging:
IF .F.
RETURN
RETRY
ENDIF
The code won't normally execute, of course, but you can use it to control how you proceed after your error handling. FWIW, I also always include and ASSERT statement in my error handler in addition to the normal user messages, error handling.