10.07.2015 Views

Programming Guide - Actian

Programming Guide - Actian

Programming Guide - Actian

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Event-based <strong>Programming</strong>The resume statement is useful for ensuring data validation. When you use theSetValue event to perform data validation for a field, the resume statementcan prevent the user from leaving the field when the data is invalid. The userremains on the field that triggered the SetValue event, unless you use theresume next statement to continue with the next operation or use theCurFrame.InputFocusField attribute to move the user to a specified field.For more information about resume next and about the InputFocusFieldattribute, see the Language Reference <strong>Guide</strong> online help.When the resume statement is executed in an event block for an event that ispart of an event chain, OpenROAD removes the remaining events in the chainfrom the event queue. For example, after a user triggers a SetValue event fora field and leaves the field, an Exit event is triggered for that field, and anEntry event is triggered for the next field getting the input focus.However, you can use the resume statement in the SetValue event block toprevent the user from entering invalid data. When the SetValue event blockexecutes the resume statement, the Exit and Entry events are removed fromthe queue and the user remains in the field with invalid data.Because the resume statement removes remaining events from an eventchain, you can use it to prevent a window from closing when the user selectsthe window manager close operation for the running frame. When the usercloses a window, OpenROAD triggers both the WindowClose and Terminateevents for the frame.To keep the window open under specified circumstances, you can put a resumestatement in a WindowClose event block. This statement removes theTerminate event from the event queue and prevents the window from closing.You cannot use a resume statement in a Terminate event to prevent thewindow from closing. Regardless of how a Terminate event block completes, italways terminates the frame and the window. For this reason, OpenROADalways processes a WindowClose event, if specified, before a Terminate eventblock.Managing Event Queues 329

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!