EVENTCHECK

Synopsis
EVENTCHECK
Description

The EVENTCHECK command is like calling YIELD immediately followed by NOYIELD. It checks to see if any events are waiting to be processed. Some commands that input "callbacks" run them in a no-yield state. If the callback code is short and quick you won't see any problems. But if it's long the user will notice that they lose control during this period. If you sprinkle a few EVENTCHECK instructions around, then the user will not lose control for such a "long" period of time.

This command can be used as an alternative to placing YIELD and NOYIELD commands around computationally intensive loops. You can wrap the whole procedure in a NOYIELD/YIELD pair then you can call EVENTCHECK in strategic locations in your loops.

Example
MOUSEON [REPEAT 72 [REPEAT 4 [FORWARD 100 RIGHT 90] RIGHT 5]] [] [] [] []
Click the mouse in FMSLogo Screen.
Note that while it is drawing you cannot HALT it, because mouse callbacks do not yield.

MOUSEON [REPEAT 72 [REPEAT 4 [FORWARD 100 RIGHT 90] RIGHT 5 EVENTCHECK]] [] [] [] []
Click the mouse in FMSLogo Screen.
Note that while it is drawing you can now HALT

SourceForge.net Logo