|
From: Mark M. <mie...@gm...> - 2013-02-21 17:13:32
|
Hi Staffan, On Thu, Feb 21, 2013 at 7:52 AM, Staffan Tylen <sta...@gm...>wrote: > Mark, I've reached a point where most likely an error in my code brings > down the whole ooRexx environment, > By 'brings down the whole ooRexx environment, do you mean the interpreter terminates, or do you mean the process crashes? I'm going to assume you mean the interpreter terminates. > but without a single message. I've noticed that while running within a > PropertySheetPage, if I do something like abc~def and abc is a .NIL object, > then the environment goes down. I usually see an error message when this > happens but in this case it's all silent so I can't determine if in fact a > .NIL object is involved. > This sounds like a problem in one of the event handlers. There should be a condition message printed out, if there isn't, I'm not sure why. > I can't even determine what method is executing even with tracing. > Turn off tracing. Put a simple say statement in each of your event handlers, as the first line. Something like: say 'enter onClick()' That should allow you to track down what method the problem is happening in. If I do that and still have a problem, then I put a leaving statement right before I return from the event handler: say 'leaving onClick()' In addition, you probably have some idea of when the problem cropped up. So, I would start with the event handlers that you suspect. > There seems to be a difference in the ooDialog error handling process when > a PropertySheet is involved, could that be so? > PropertySheetDialog dialogs are unlike all other ooDialog dialogs in that they are manged by the operating system, not by the ooDialog framework. That fact is going to cause differences. In addition, calling back into the interpreter from the native C / C++ code in the window message processing loop brings up issues different from other types of Rexx programs. In particular, if you have a syntax error in the Rexx call back method, it can lead to every thing getting hung, and you have to kill the rexx.exe process through the task monitor to get out of the hang. Terminating the underlying dialog and the interpreter when a syntax condition in an event handler is detected prevents the hangs. The syntax message should be printed out. Many times, the syntax condition in the event handler may not cause a hang. But, with a PropertySheetDialog dialog, it is much more likely that things will hang. In fact it is almost a certainty. So, when I started working on property sheet functionality, I started being more careful about ending the underlying dialog when a syntax condition in an event handler happens. So, this is a little different than with other dialogs where I was not as careful about checking for syntax conditions. As I said though, the syntax condition should be printed out. Since it isn't, I would say that without the terminating code, you would just see your program hang with no message, and have to kill rexx.exe through the task manager. As always, if you can produce an example that shows the problem I can most likely figure out what the cause is. I suspect that may be difficult in this case. But, if you can I'll gladly look at it. -- Mark Miesfeld |