ENG0040 Error Promoted Events (OpenInsight 32-bit Specific)
At 31 MAY 2005 07:48:39PM Mark Ford wrote:
I am using a Promoted event for my Save (F9) routine. The system correctly activates the main promoted event program, passes control to the menu (Menu$) program and then returns control back to the main Promoted_Event program. The Menu$ Save logic works the problem arises when control is passed back to the main Promoted_Event program. The system crashes each time the Return 1 command is executed from the Promoted_Event program. The error message is "ENG0040 Run_Event, Line 1 The label common variable has been freed and is no longer valid".
If I change the Return 1 to Return 0 then the system crashes with a RTP27 Source code not available error.
Help to debug this problem would be appreciated.
Sample of the Promoted_Event program code is as follows:
Begin case
case event= 1 ; gosub GotFocus$case event= 2 ; gosub LostFocus$case event= 3 ; gosub Click$case event= 4 ; gosub Menus$end casereturn 1
*
GotFocus$:
call surveyit_GotFocus(CtrlEntId,CtrlClassId,Parm1,Parm2,Parm3,Parm4,Parm5,Parm6,Parm7,Parm8)RETURN*
LostFocus$:
call surveyit_LostFocus(CtrlEntId,CtrlClassId,Parm1,Parm2,Parm3,Parm4,Parm5,Parm6,Parm7,Parm8)RETURN*
Click$:
call surveyit_Click(CtrlEntId,CtrlClassId,Parm1,Parm2,Parm3,Parm4,Parm5,Parm6,Parm7,Parm8)RETURN*
Menus$:
call surveyit_Menus(CtrlEntId,CtrlClassId,Parm1,Parm2,Parm3,Parm4,Parm5,Parm6,Parm7,Parm8)RETURN*
RightClick$:
call surveyit_RightClickFocus(CtrlEntId,CtrlClassId,Parm1,Parm2,Parm3,Parm4,Parm5,Parm6,Parm7,Parm8)RETURN*
Create$:
call surveyit_Create(CtrlEntId,CtrlClassId,Parm1,Parm2,Parm3,Parm4,Parm5,Parm6,Parm7,Parm8)RETURN
At 01 JUN 2005 12:21AM Barry Stevens wrote:
You havent closed the window during one of these process have you.
At 01 JUN 2005 03:29PM Mark Ford wrote:
You are quit correct it is the closing of the window that is causing the error.
In my save Promoted_Event Menu save (F9) return the record is saved and window closed. Control is passed back to the calling window but the Run_Event error is generated.
Case parm1=SAVE'
status=send_event(CtrlEntId, "WRITE");*record is written=end_window(@window) ;* Stop execution of running windowreturn 0What command should I be using to give focus to the calling window 'ST_MAIN_FRAME'?
At 01 JUN 2005 03:45PM support@sprezzatura.com wrote:
You should POST_EVENT "CLOSE" to allow your program to finish execution before closing the window.
support@sprezzatura.com
The Sprezzatura Group Web Site
World Leaders in all things RevSoft
At 01 JUN 2005 10:00PM Barry Stevens wrote:
You should actually test the event status of the write, in case there is a "required field" error.