OIPI won't close (OpenInsight 32-Bit)
At 03 JUN 2002 09:54:58AM Richard Richter wrote:
After some searching I have narrowed down a problem to OIPI.
My opening window for my application runs perfectly under 4.0.2 on Win2K and NT. It is a tabbed window so there is some code in the CREATE envent. When I place:
Call Set_Printer('START32')
in the CREATE event of the window and place:
Call Set_Printer('STOP32')
in the CLOSE event of the window the window runs perfectly and the report runs perfectly until I try to close the window. The only way to close the window is with the End Tast button in the Task Manager. The same thing happens on 3.75 copy at home. I'm at my wits end what to do with this. Mike or Tony, have you heard this before?
Thanks,
Richard Richter
At 03 JUN 2002 01:01PM Don Miller - C3 Inc. wrote:
Are you sure that the Stop32 is actually being executed? How have you coded the Close event? Is it possible some other task is not forwarding the event chain so that the Stop32 gets executed? Make sure you set Status before any process call and check it afterwards.
Don Miller
At 03 JUN 2002 01:58PM Richard Richter wrote:
This is the code used in the CLOSE event:
Call Set_Printer('STOP32')
RETURN 0
How would I know if it's not firing?
Thanks
Richard
At 03 JUN 2002 02:05PM Richard Hunt wrote:
Richard,
Try changing the "RETURN 0" to "RETURN 1".
At 03 JUN 2002 02:13PM Richard Richter wrote:
That did it. What is the difference between RETURN 0 and RETURN 1?
Richard
At 03 JUN 2002 04:56PM Richard Bright wrote:
Return 1 says continue with the processing of this event. In some events there is no event process logic. But in the case of GotFocus, Read, Write, Close there is a bunch of logic that takes places.
Think of the event script as exposing a point to insert code pre-process, that is before the event takes place. The return value (0 or 1 ) says continue or stop here.
Now if you want to run some process AFTER the event logic then we do a forward_event() - which gets the event logic to occur, then it returns to this script, runs your code which now should end with Return 0 (because you have already run the event logic.
Note that a quick event is the same as the script in which you have done a forward_event() and now are doing a post-event process. This has important implication for read and write events ie wgere do you want to trap the event process and manipulate data.
Richard Bright
At 04 JUN 2002 09:24AM Richard Richter wrote:
Thanks.
That's a great description. I wish we could get manuals with clear explanations like that.
Richard
At 05 JUN 2002 05:42AM Richard Bright wrote:
Sorry, the explanation WAS rather garbled.
BTW you will find two other event commands in addition to
forward_event() - which crudely means process the event logic CHAIN for THIS event now. Note that CtrlEntId does not need specifying because it is THIS event - but will have to pass event params as required by event.
The two other commands are
send_event() - which means fire some OTHER event (and then come back to finish off this code)
post_event() - put in the event que to be processed at some unspecified time - maybe after more urgent things arre processed.
A further note. Often you do not have to send_event programatically to get an event chain to occur. That is, by using Set_property/focus - from one control to another control, events like lostFocus will occur without programatic initiation. eg form called programatically and key value is stuffedinto the key control and a read is forced to populate the form with the record as the form opens - accomplished by Set_Property.
Richard Bright