Functions and Directives

Function NextAppEvent() Foundation

Retrieves the next event without removing it from the event queue.

Syntax
NextAppEvent( [@mp1], [@mp2], [@oXbp] ) --> nEvent
Parameters
<mp1>
The first message parameter of the event is assigned to <mp1>within NextAppEvent(). The variable is optional, but if it is passed it must always be passed to NextAppEvent() by reference.
<mp2>
The second message parameter of the event is assigned to <mp2>within NextAppEvent(). The variable is optional, but if it is passed it must always be passed to NextAppEvent() by reference.
<oXbp>
The addressee of the message (event) is assigned to the variable <oXbp> within NextAppEvent(). This parameter is also optional but is needed in connection with Xbase Parts. As an example, it might indicate an Xbase Part clicked with the mouse.
Return

The return value of NextAppEvent() is a numeric code identifying the event which will be removed next from the queue. Generally, these are events generated by keyboard or mouse activity. The #include file Appevent.ch contains #define constants for the integer numeric event codes.

Description

The function NextAppEvent() returns the next pending event code found in the event queue. If the optional parameters <mp1>, <mp2>, and <oXbp> are included, they are filled with the values of the message parameters and the corresponding Xbase Part associated with the event. The parameters have the same meaning and contain the same values as those returned by a call to the function AppEvent() (see AppEvent()). NextAppEvent() differs from AppEvent() in that NextAppEvent() does not remove the event from the event queue.

Examples
NextAppEvent()
// The example shows one way in which multiple events 
// signaling mouse movement, can be filtered so 
// that only the last event is displayed. 

#include "Appevent.ch" 

PROCEDURE Main 
   LOCAL nEvent, mp1, mp2, oXbp 
   CLS 

   SetMouse(.T.) 

   DO WHILE nEvent <> xbeK_ESC 
      nEvent := AppEvent( @mp1, @mp2, @oXbp, 0 ) 

      IF NextAppEvent() == xbeM_Motion 
         LOOP 
      ENDIF 
      ? nEvent 
   ENDDO 

RETURN 
Feedback

If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.