guides:programming:programmers_reference_manual:forward_event

Forward_Event subroutine

Suspends execution of the current event handler and transfers to the next handler in the event chain.

Call Forward_Event(Param1, Param2, Param3, …, Param20 )

NameRequiredDescription
Param1 - Param20NoEvent-specific parameters to be forwarded to the next handler.



Note that all events are passed two common parameters – CtrlEntID and CtrlClassID. These should not be passed to Forward_Event, only the parameters that are specific to the event need to be passed.

N/A

Error information is returned in the same format as for Get_EventStatus.

This subroutine is normally called from an event script to hand control over to some lower level system code (e.g during a READ event to perform the actual system READ process) before executing some post processing.

The Get_EventStatus function should be used to check the status of the forwarded event for any errors.

Note: You should always return FALSE$ from your event script if you have called Forward_Event(), otherwise the next handler will be called again.

 
//// Example - A POSCHANGED event script on an EditTable that uses Forward_Event//
   ////           to validate the cell contents first before going on to make any//
   ////           subsequent changes.//
   //////
   //// POSCHANGED is passed four arguments://
   //////
   ////   CtrlEntID   - ID of the control that triggered the event//
   ////   CtrlClassID - Class of the control that triggered the event//
   ////   NextColumn  - Column index of the cell that is now current// 
   ////   NextRow     - Row index of the cell that is now current//
   
   function PosChanged( CtrlEntID, CtrlClassID, NextColumn, NextRow )
   
      Declare Function Get_EventStatus
      $Insert RTI_SSP_Equates
      $Insert Logical
      
      evError = ""
      
      //// Ensure we have a clean slate //
      Call Set_EventStatus( SETSTAT_OK$ )
      
      //// Forward the event to perform validation - the system-level POSCHANGED//
      //// handler does this.//
      Call Forward_Event( NextColumn, NextRow )
      
      //// Check for errors//
      If Get_EventStatus( evError ) Then
         //// We failed validation so do nothing here - the focus will have been //
         //// moved back to the offending cell//
         Null
      End Else
         //// We passed - so do some post processing ...//
         Call Set_Property_Only( @Window, "TEXT", NextColumn : " - " : NextRow )
      End
   
   Return FALSE$
 
 
 

Get_EventStatus function, Set_EventStatus function.

  • guides/programming/programmers_reference_manual/forward_event.txt
  • Last modified: 2023/10/25 10:49
  • by 127.0.0.1