| Discussion |
Keywords: ErrHandler, Suggestion, VFP
Remote Name: 22.214.171.124
I wouldn't want to add that much complexity (hence potential for error) to this core dialog. Since it may be called from an error handler, where VFP tolerates no nested errors, the diagnostic message dialog must be as robust as possible.
I recommend that you simply make sure that SKPBAR('_MSM_PROG', _MPR_RESUM) is well-defined if you want to use the dialog's Suspend/Resume buttons under the VFP Development System. This implies that you must observe certain precautions if you redefine the standard VFP Dev Sys menus. That still gives you lots of flexibility, including the ability to disable or hide Suspend and Resume in your customized menus.
If SKPBAR('_MSM_PROG', _MPR_RESUM) is not well-defined, there is no satisfactory test that I know which the program can use to determine whether it is currently suspended, and behave accordingly. Again, I want this dialog to be as robust as possible, so I disable both the Suspend and Resume buttons if the preceding SKPBAR expression is undefined. Otherwise I'd be opening the door to a greater risk of unhandled errors.
There's no question that the situation isn't ideal, but I think the problem stems from a couple of small flaws or omissions in VFP. It would be nice if there were a cleaner test as to a program's suspended-ness, e.g. a built-in function ISSUSPENDED( ), so I wouldn't need to resort to the present SKPBAR hack.
Another basic VFP problem, as far as I've discovered to date, is that the RESUME command doesn't work in programmatic code. It only works if you type it in the command window, or if you invoke VFP's Program, Resume menu option (or an equivalent). There is a bit of a logical quandary here: how can a suspended program execute anything? (Note that many controls won't work properly while a form is suspended.) I consider myself lucky to have come up with any way at all of supporting the Suspend and Resume buttons, and only with the kludge of last resort - a KEYBOARD hack!
Perhaps VFP 7 has something more to offer in this area, or maybe someone can enlighten me about a better solution. Otherwise the only further improvement I've thought of so far is erma0021: more flexible Resume command button implementation.