MSM-Workstation
Macros

Go back to the alphabetic list of macros
Go back to the first page of this tutorial

%%EvNext

This macro generates code that returns a specification of the value of a property of the most recent event.

The property for which the value is returned by this macro is the identification of the next control, if any, that received focus in the context of this event, which is equal to ^$Event("NEXTFOCUS").

Typically, one doesn't worry too much about the sequence in which the end-user traverses the various components in a window. When a control should not be "reachable", it will typically be "grayed out", and when accessing controls involves executing "action logic", code should be executed to check whether all required fields have an appropriate value, and use relevant default values for those fields that have not been defined yet.

This macro becomes interesting in those occasions where it does matter in which order the various components are traversed.

Examples

Assume that the window represents a chess-board, and that the squares on the chess-board are represented by controls with names like "c11", "c12", etcetera through "c88".

Set from=%%EvControl,to=%%EvNext
Set hor=$e(to,2)-$e(from,2)
Set ver=$e(to,3)-$e(from,3)
If ".ab.ba"[$tr("."_hor_ver_".","12-","ab")

would validate that the move being requested is a valid one for a knight in the game of chess.

See also

%%EvChoice, %%EvControl, %%EvElement, %%EvKey, %%EvPrior, %%EvPtrButton, %%EvPtrPos, %%EvPtrState, %%EvSequence, %%EvType and %%EvWindow.