Set_EventStatus function
Description
Sets the status of the currently executing event.
Syntax
Call Get_EventStatus( Status, ErrorCode, ErrorArgs )
Parameters
Name | Required | Description |
---|---|---|
Status | Yes | Status of the event. Can be one of the following: "0" : Success, no error "1" : Failure – error has occurred "-1" : Failure – append error to existing status (Equated constants for these values may be found in the RTI_SSP_Equates insert record). |
ErrorCode | Depends | Contains a code indicating the exact nature of the error. This is usually a number prefixed by the string "EV". Required if Status indicates a failure (1 or -1), ignored otherwise. |
ErrorArgs | No | Contains an @Fm or @Vm delimited list of arguments associated with ErrorCode. They are used to replace numeric placeholder tokens in error text associated with the ErrorCode. |
Returns
N/A
Errors
N/A
Remarks
Equates for event error codes can be found in the EVERRORS insert record. Error information may be translated into a textual format by using the RTI_ErrorText function.
In some circumstances the Event Status is used to return data to a calling stored procedure and does NOT actually indicate an error condition. This can happen for the following "EV" ErrorCodes:
• "EV200": Used to return a result to the Presentation Server from a synchronous WINMSG event.
• "EV999": Used to return a value directly from Send_Event to a calling stored procedure.
Example
$Insert EvErrors $Insert RTI_SSP_Equates * // Example WRITE event handler - check to see if we have all the * // data that we need. OK = TRUE$ ValidErr = "" GoSub ValidateFormData; * // (Assume this sets OK and ValidErr) If OK Then * // All good - let the system write the data record Call Forward_Event() End Else * // Failed - set an EventStatus to let the caller know that * // the was a problem. We can use one of the predefined EV * // errors or create our own. * // * // For this we'll use the EV_VALIDERR$ and also use the SYSMSG * // event to display a message. Call Set_EventStatus( SETSTAT_ERR$, EV_VALIDERR$, "" ) Call Send_Event( @Window, "VALIDERR", ValidErr ) End * // Because we called Forward_Event we stop the event chain * // here by returning FALSE$ Return FALSE$
See Also
Forward_Event, Get_EventStatus.