[<<Previous Entry]
[^^Up^^]
[Next Entry>>]
[Menu]
[About The Guide]
SysRefresh() -> <lQuit>
--------------------------------------------------------------------------------
RETURNS:
<lQuit> A logical value indicating that a WM_QUIT message was
issued, so that the application should be finished.
DESCRIPTION:
This FiveWin function is very important and has no counterpart in the
standard Windows API. SysRefresh() processes all pending messages,
so that Windows can keep controlling all its pending activities.
The big benefit and advantage of SysRefresh() is that let us keep doing
a 'normal' linear programming without having to send ourselves messages
to keep processing a long task. For such tasks, we must use SysRefresh()
from inside those processes that may be time consuming.
Consider you are going to execute a long time DO...WHILE or
FOR...NEXT loop.
In that situations it is very important to let Windows process its pending
messages so that your application may continue execution without returning
control to Windows. You can do so by inserting a call to Sysrefresh() in
the loop:
+-------------------------------------------------------------+
| /* Process Messages in a Loop */ |
| cx := 1 |
| |
| DO WHILE lCondition |
| * Do some Action |
| Whatever() |
| |
| * Every 10 times call sysrefresh() |
| IF( cx++ == 10 ) |
| cx := 0 |
| Sysrefresh() |
| ENDIF |
| |
| ENDDO |
+-------------------------------------------------------------+
This little function lets us change drastically the way Windows operates
to make life easier for xBase programmers.
Without it, you would not be able to stop an endless loop or end the
application, because windows would not have any chance to process the
message to do so !
On the other hand, sysrefresh() should not be spread all over the code
in a "can't hurt" mode. It is a very potent function and should only be
used where it is needed !
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson