Join The Works program to have access to the most current content, and to be able to ask questions and get answers from Revelation staff and the Revelation community

At 21 OCT 2010 02:53:58PM chip fichot wrote:

Hello -

OI v 8.0.8

We have a window which has given us intermittent issues in the past with the error "ENG0040: RUN_EVENT line 1. The labelled common variable has been freed and is no longer valid".

I believe that the issue stems from the fact that the window is being called using Dialog_Box but it is being closed through the regular event processing (i.e. no End_Dialog present).

While doing an update to the window, I wanted to address this.

This window may need to be invoked as an MDI Child or as a dialog box, depending on the context, so I am setting a variable (@CALLINGMODE) in the create event and setting the value to "DIALOG" if the window is invoked through the Dialog_Box function.

To correctly close the window using End_Dialog if invoked through that command, I re-worked the Close event with the following code:

CallingMode=Get_Property(@WINDOW,"@CALLINGMODE")

If CallingMode _eqc "DIALOG" then

Call End_Dialog(@WINDOW)
Return 0 

End Else

Return 1

End

This is closing the window properly, but it is not releasing the lock on the record if the window is invoked using Dialog_Box (however, it is behaving properly if the window is invoked using Start_MDIChild).

I have another window that I created from scratch using the same logic and I confirmed that it, too, is not releasing the lock when invoking END_DIALOG.

If anybody has any input, it would be greatly appreciated.

TIA,

Chip


At 21 OCT 2010 03:35PM cpates@sprezzatura.com wrote:

Chip,

How about sending a CLEAR event to the window before your end_dialog call?

The normal CLOSE event handles the unlocking but this doesn't get called in the case of end_Dialog - instead the dialog return value is updated and an internal End_Window() is called.

cpates@sprezzatura.com

Captain's Blog

Battlestar Sprezzatura - BSG 77

Colonial leaders in all things RevSoft


At 21 OCT 2010 04:03PM chip fichot wrote:

Thanks Carl - I think I was over-thinking this. That worked like a charm!

View this thread on the Works forum...

  • third_party_content/community/commentary/forums_works/d7e5a405b09df330852577c30067d15e.txt
  • Last modified: 2023/12/30 11:57
  • by 127.0.0.1