In general, the effect of this macro is to indicate skipping of subsequent action logic that would normally be performed to complete the handling of the event that invoked the current action logic.
The precise effects of this macro vary, according to the action logic in which its code is executed. For example, use in the logic for the low-level close event on a GUI window will prevent execution of the code from the system supplied %%Return macro that would otherwise close the window.
I MyVar<Yours %%NotOK Q
In the lostFocus logic of a
GUI Text control, prevent execution of any code in the action
logic for the modified event and
return the focus to the control.
Event | Effect |
---|---|
Any event | Prevents any chained event from occurring, so suppressing the action logic on that event. |
Window Create | Prevents any Control Create events from occurring. If the Window Create arose from a %%Do, %%DoWin or %%OpenWin call needing to create the window (which is normally the case) the macro %%NotOK leads to the window not being created and the call returning immediately. |
Control Create | Prevents Control Create events for any following controls (in collating sequence of control name). If the Control Create arose from a Window Create (which is normally the case) the %%NotOK is applied to the Window Create too. For the meaning of this, see the Window Create entry in this table. |
Window Destroy | Prevents the kill of the window. Prevents Control Destroy events from occurring. If the Window Destroy arose from a non-hiding %%Return or %%Cancel (which is normally the case) the %%Return or %%Cancel operation still completes. The logic that signalled %%NotOK should probably %%Hide the window itself. |
lostFocus (Window or Control) | Kills ^$EVENT("OK"). When the action logic quits this sets the focus back to the control or window that caused the lostFocus (i.e. the MWAPI UNFOCUS) event, suppressing any gotFocus (i.e. MWAPI FOCUS) that might accompany the lostFocus, discarding deferred events and reversing visible changes. |
change, Modified | As for Control lostFocus. In addition, the MWAPI attribute CHANGED is not automatically cleared in the way that occurs when a change event completes normally. The effect of this is that a subsequent user attempt to unfocus from the control will give rise to another change event. |
close | Prevents execution of the default %%Return macro supplied by the compiler |