05-27-2013 08:33 AM
I preapred a program to test something but I get error 1122 when I stopped the program. What is wrong with it?
05-27-2013 10:06 PM
There's nothing wrong, you just need to ignore the error. The error text describes what happened fairly clearly, I think. When you push the stop button, the top loop exits and destroys the queue. The bottom loop was waiting to dequeue from that queue, and suddenly the queue was destroyed. The way your code is written, you need that error to stop the bottom loop (and there's nothing wrong with that, I use this approach all the time). You may want to add some code that checks if error 1122 occurs, and if so clears the error, after you exit the bottom loop.
05-28-2013 01:00 AM - edited 05-28-2013 01:13 AM
How can I do that? I have never done something like that before? How can I detect the code and ignore it?
Edit: When I change the program as in the attachment, the error message does not pop-up. What is the difference? I do not understand.
05-28-2013 12:23 PM
@newbieeng wrote:
How can I do that? I have never done something like that before? How can I detect the code and ignore it?
The easiest way is probably to use the the General Error Handler function in the Dialog & Error palette. It has an input that lets you ignore a list of error codes; see the help for details.
newbieeng wrote:
Edit: When I change the program as in the attachment, the error message does not pop-up. What is the difference? I do not understand.
Basic dataflow. The error occurs at the Dequeue function. With your change, the error output from Dequeue stops at the case structure. In your previous code, that error travels all the way to the Simple Error Handler, which is the function that pops up the dialog box. If that's not clear, try running your code with execution highlighting (the light bulb icon in the toolbar) and watch how the error travels along the wires when you push the stop button.
05-28-2013 12:29 PM
Ok thanks. I handled with the problem. 😄