L
Laura Stern
Guest
Yes, certainly, ON STOP UNDO, RETRY works around a classic WAIT-FOR. I guess I missed that you said it did not. It will generally not work however for a WAIT-FOR Application:Run() (.NETt-style) as .NET itself governs some of this behavior. The main form will be Disposed and gone and would have to be recreated. Plus .NET will often not let you call Run() again. The way I would do the ON STOP logic is this - just using a local variable for this example, but you could replace that with a static class member. DEFINE VAR haveStop AS LOGICAL. DO ON STOP UNDO, LEAVE: haveStop = yes. RUN bar.p. haveStop = NO. /* won't execute if STOP actually happens */ END. IF haveStop THEN ... But what I'm not understanding now is that the way you've coded this, you will first see the system error message "xxx.p was not found (293)". So why would you need to trap the name and display this message yourself. It is redundant. So this only makes sense if you can suppress the system error message. Though I don't see that the message you are showing is any nicer than just seeing error 293, so I don't get the point. But to complete the story, the only way not to see that system error is to have something like OUTPUT TO in effect when the RUN happens. If it fails the error message will go to the file not to the screen. But then you probably do NOT want this in effect during execution of the .p if it does exist and does run. So you could do OUTPUT TO before each run and OUTPUT CLOSE at the top of each .p.
Continue reading...
Continue reading...