oi10:presentation_server:get_eventstatus

Get_EventStatus function

Retrieves the status of a fowarded event.

IsError = Get_EventStatus( EventStatus )

NameRequiredDescription
EventStatusNoIf passed then Get_EventStatus will return error information in this parameter.

If an error has been flagged for an event then this function returns TRUE$, and places the error information in the EventStatus parameter (if passed). The EventStatus is an @fm-delimited list of errors, each with the following format:

<0,1> Event Error Code

<0,2> to <0,n> Error arguments associated with the code.

If no error has occurred then this function returns FALSE$.

N/A

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 (see example below).

 
Declare Function Get_EventStatus, RTI_ErrorText

   $Insert Logical

   

   * // Example - assume this is an Event Script for a CLEAR event on a

   * // window and we want to execute some post-CLEAR event code if the

   * // form was reset correctly.

   

   * // First we forward the CLEAR event, which should ensure that the

   * // data has been saved correctly if changed - To check if this is

   * // successful we use Get_EventStatus.

   

   * // Clear the form, passing the CLEAR event arguments:

   * //

   * //    bSaveKey,

   * //    bSuppressWarning

   * //    bMaintainFocus

   

   Call Set_EventStatus( FALSE$ )

   EvErrors = ""

   

   Call Forward_Event( bSaveKey, bSuppressWarning, bMaintainFocus )

   

   If Get_EventStatus( EvErrors ) Then

      * // We have some error codes - make sure they are formatted

      * // into text messages and display

      ErrCount = FieldCount( EvErrors, @Fm )

      ErrText  = ""

      For ErrIdx = 1 To ErrCount

         ErrText := RTI_ErrorText( "EV", EvErrors<ErrIdx> ) : @Tm

      Next

      ErrText[-1,1] = ""

      Call Msg( @Window, ErrText )

   End Else

      * // Do post-clear processing ...

   End

   

   * // Because we've used Forward_Event we MUST return 0 from the

   * // event to stop the event chain from being repeated.

   Return 0
 
  • oi10/presentation_server/get_eventstatus.txt
  • Last modified: 2023/10/25 10:49
  • by 127.0.0.1