3. Statements : OpenROAD Language Statements : Resume Statement
 
Share this page                  
Resume Statement
This statement ends the currently executing event block.
This statement has the following syntax:
resume [next];
You can use the resume statement in two ways:
Without the next keyword
Ends the current operation and repositions the input focus on the screen at the field designated in CurFrame.InputFocusField
With the next keyword
Gives control to the next pending event that was triggered by the original action in the event block
When you omit the next keyword, the field designated in the InputFocusField attribute is the field that last had the input focus when the event block was activated. You can force the control to resume to a specific field by explicitly setting the InputFocusField attribute of the FrameExec object to the field on which you want to position the cursor.
Because user actions can trigger more than one event, be aware that if you do not use the next keyword, these events are discarded. For example, assume that a user tabs between two entry fields, A and B, and that the script defines an Exit event for A and an Entry event for B. If the event block for the Exit event contains a resume statement, when resume executes, OpenROAD positions the cursor on field A and does not process the Entry event for field B. If the event block for the Exit event contains a resume next statement, when that statement is executed, OpenROAD positions the cursor on field B and processes the Entry event for the field.
For a description of event chains and event processing, see the Programming Guide.
A resume statement never discards pending database events and, in most cases, does not discard user events. The exception can occur when the SendUserEvent call that sends the user event sets the focus behavior of the current field in the receiving frame to FT_SETVALUE or FT_TAKEFOCUS. This action establishes an event chain that begins with a SetValue event and contains the user event. If any event block ahead of the user event block in the chain executes a resume statement (without the keyword next), then OpenROAD discards the rest of the chain, including the user event.
Because the resume statement terminates the event, it is typically the last statement in an event block or in the statement list of an if statement. Statements following a resume statement are not executed. The resume statement is often used in a SetValue validation if the condition fails.
The resume statement can be used in a local or global procedure. It terminates the currently executing event block (for example, the event block that directly or indirectly called the procedure containing the resume statement). If there is no currently executing event block, the application is terminated. The resume statement also terminates the procedure and all procedures above it in the call stack until a frame is found.