Post by Stefan on Jan 22, 2021 6:59:18 GMT -5
George,
At present, if all is well and SPFLIte just has a lot of work to do, pressing the <OK> resumes the process.
If the user suspects that there's a problem and SPFLIte may be looping out of control, pressing the <CANCEL> button kills the application, with certain data loss.
I'm only guessing here, but the fact that the pop-up window contains information like the last commands entered and a trace of modules executed, suggests that you have the ability to execute some code in there that is SPFLite-aware to collect such stats.
1st suggestion:
It would be useful if the currently executing primary command or line command were mentioned here, together with the line number (as perceived by the user) of the line being processed.
My rationale is that it allows the user to click <OK> and when/if the dialog pops up again see if the process has actually made progress or is in a tight loop and needs <CANCEL>.
I'm also guessing, but given that <OK> resumes the loop without any issue, why could <CANCEL> not do the same thing, but with a twist?
2nd suggestion:
What if pressing <CANCEL> were to (1) set a global variable accessible to all SPFLite modules/threads and then (2) resume the loop the same way <OK> does?
I appreciate this next bit will make you groan, but...
you could check inside each loop if the CANCEL_Flag is set and effectively 'LEAVE' (EXIT FOR, EXIT EXIT WHILE, etc) that loop.
Called routines can pass back suitable return code, or the caller could check the flag themselves.
You'd pop out of whatever loop nesting you were in and eventually whatever primary or line command was being aborted.
The screen display can check the CANCEL_FLag too and present an appropriate COMMAND ABORTED message when refreshing the display.
All the user has lost is the proceeds of the command that was running. The clean up may require little more than an UNDO.
Data in all other open tabs is safe.
3rd suggestion:
Would it be possible to add a third button to the dialog that does kill SPFLite altogether - useful as a safety parachute.
You might then have <OK> (although I'd prefer <CONTINUE>). <ABORT Command> for 2nd suggestion and <TERMINATE> for Kill me now!
It happens rarely, and the loop-exit effort would be substantial. So I understand if you don't consider it worthwhile.