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 05 APR 2007 02:18:10AM Barry Stevens wrote:

I am getting:

""ENG0040: %1%, line %2%. The labelled common variable has been freed and is no longer valid "

when trying to send_event CLOSE a window in the ssp called by the read event. post_event CLOSE does nothing.

The data bound window is called as a dialog (program data feed loop)


At 05 APR 2007 02:33AM Barry Stevens wrote:

Ooops, sorry i cheated:

ENG0040: RUN_EVENT line 1. The labelled common variable has been freed and is no longer valid


At 05 APR 2007 03:32AM Paul Evans wrote:

Hi Barry,

I believe this is all to do with event chaining. Your stored proceedure is returning from whence it came - the read event - but it no longer exists - you closed the window with your send_event. Try using a post_event in your stored procedure. That way the read event will still exist, your program can return, your post_event 'close' can then execute and everyone is happy.

Regards,

PaulE


At 05 APR 2007 10:10AM Sean FitzSimons wrote:

Barry,

If the window was started using the Dialog_Box function then close the window with an End_Dialog call. You could place the End_Dialog call after your read processing instead of sending the Close event.

Sean


At 06 APR 2007 12:23AM Barry Stevens wrote:

Sorry, my mistake the window is being called as follows (so can access mdi menus)

This is how called:

*

WinId=startmdichild("SCH_CUTTING_SHEET","MAINMENU",CreateParam)

loop

Handle=get_property(WinId,"HANDLE")

while Handle

yield()

repeat

*

This is the code in the read event script:

*

ssp=@window1,"*"

call @ssp(CtrlEntId,"READ")

RETURN 0 ELSE

MSG('Order Number Not Found.|Unable to Continue Please      exit.','A','','')
send_event(@Window,"CLOSE")
RETURN

END

**

If put close in other event it closes ok

if called as dialog, closes ok

if remove the handle loop, closes ok!!!!

Help!!!!!!!!!!


At 06 APR 2007 01:49AM [email protected]'s Don Bakke wrote:

Barry,

I recreated your scenario and was able to get the error message. However, when I try the Post_Event method (as Paul suggested) the window successfully closes without the error message.

As Paul described, you are still executing event context code after you close the window. Once the window closes the labelled commons are no longer valid.

[email protected]

SRP Computer Solutions, Inc.


At 06 APR 2007 09:09AM Barry Stevens wrote:

Sorry, I should have said that nothing happened with the post_event.

OK, I will dig deeper then.


At 06 APR 2007 11:20AM [email protected]'s Don Bakke wrote:

Barry,

You did mention that Post_Event didn't work in your original post. I just wanted to encourage you to look again. Something else must being going on in your system to prevent Post_Event from working. Did you see Richard Hunt's recent post about Post_Event calls failing to work after getting the debugger screen? This might be related to what you are experiencing.

[email protected]

SRP Computer Solutions, Inc.

View this thread on the Works forum...

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