OnEvent calls a SRT. While in the SRT OnEvent is disabled while event is logged and handled, when the SRT is finished OnEvent is enabled again for the next event. That is how it should work.
However, if the OnEvent SRT does a GoSub>AnotherSRT, OnEvent is immediately re-enabled. This is incorrect. In the case of a WINDOW_OPEN event the OnEvent SRT will be called repeatedly before the original instance has returned from AnotherSRT.
The OnEvent should remain disabled until the original SRT has finished or does an unconditional GoTo to a label outside the original SRT.
This defect may not be noticed for instantaneous events such as key press or Window_CLOSE events.
In the example below, SRT>HandleError is never called.
OnEvent>WINDOW_OPEN,Error*,2,ProcessError,Error*
SRT>ProcessError
GoSub>LogError,%ProcessError_Var_1%
GoSub>HandleError,%ProcessError_Var_1%
END>ProcessError
SRT>LogError
//Code to Capture image/OCR, log to result file
END>LogError
SRT>HandleError
//Code to close the window
END>HandleError
Gale