Function LastAppEvent() Foundation

Determines the last event removed from the event queue.

Syntax
LastAppEvent( [@mp1], [@mp2], [@oXbp], [<nThreadID>] ) --> nEvent
Parameters
<mp1>
The first message parameter of the event is assigned to <mp1>within LastAppEvent(). The variable is optional, but if it is passed it must always be passed to LastAppEvent() by reference.
<mp2>
The second message parameter of the event is assigned to <mp2>within LastAppEvent(). The variable is optional, but if it is passed it must always be passed to LastAppEvent() by reference.
<oXbp>
The addressee of the message (event) is assigned to the variable <oXbp> within LastAppEvent(). 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.
<nThreadID>
The numeric ID of a thread, or Thread object, respectively, can be specified with <nThreadID>. The parameter defaults to the ID of the thread which executes LastAppEvent(). This is the current thread.
Return

The return value of LastAppEvent() is a numeric code identifying the last event removed 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 LastAppEvent() provides the last event code read from the queue using AppEvent(). If the optional parameters <mp1>, <mp2> and <oXbp> are included, they will be filled with the values of the message parameters and, if available, the Xbase Part corresponding to the last event taken from the queue. The three parameters have the same meaning as they do with the function AppEvent() (see the section on the function AppEvent()).

When a program runs in multiple threads, each thread has its own event queue. By specifying the corresponding thread ID, it is possible to obtain the last event taken from the event queue of a particular thread.

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.