Was this helpful?
ReasonCode Attribute
Data Type: integer
4GL Access: R
The ReasonCode attribute identifies the type of operation that caused an event.
This attribute is useful in event blocks in which it is important to know what type of operation activated the block. For example, assume that you have a single entry field on a form and want a user to be able to type multiple values into that field. The user enters a value, then presses the Tab key to enter another value. When there are no more values to enter, the user presses the key defined as newline. The following code implements this functionality:
on exit field1 =
    begin
    if CurFrame.ReasonCode = RC_NEXT then
    CurFrame.InputFocusField = field(field1);
    endif;
end
Valid values for the ReasonCode attribute vary by event. For a listing of reason codes, see ReasonCode Settings for FrameExec.
Last modified date: 12/20/2023