Page 1 of 1

FW using processortime

PostPosted: Tue Jan 30, 2007 5:02 pm
by driessen
Hello,

How can I prevent that the next loop is using 100% processortime ?

This is the loop :

------------------------------
DO WHILE .T.
IF VActive
SYSREFRESH()
LOOP
ENDIF
EXIT
ENDDO
------------------------------

Thanks a lot in advance.

Michel D.
M&A Consult bvba
Genk (Belgium)

PostPosted: Tue Jan 30, 2007 5:07 pm
by Antonio Linares
Michel,

Try Sleep( 1 ) instead of Sysrefresh()

PostPosted: Wed Jan 31, 2007 5:01 pm
by Otto
Couldn't you use a timer?
Regards
Otto

PostPosted: Wed Jan 31, 2007 11:01 pm
by driessen
Antonio,
Otto,

Thanks a lot for you answers.

Antonio, sleep() is an unknown function in FW for Clipper.

Otto, I never thought of a timer. I'll try it out.

Thank you.

Michel

PostPosted: Thu Feb 01, 2007 8:03 am
by Enrico Maria Giordano
This is a working sample of Sleep() definition:

Code: Select all  Expand view
#include "Fivewin.ch"


FUNCTION MAIN()

    SLEEP( 2000 )

    RETURN NIL


DLL32 FUNCTION SLEEP( nMilliseconds AS DWORD ) AS VOID;
      PASCAL FROM "Sleep" LIB "kernel32.dll"


EMG

PostPosted: Fri Feb 09, 2007 11:45 pm
by driessen
Thanks a lot guys.

I'll try out your suggestions.

Michel

PostPosted: Sat Feb 10, 2007 7:00 am
by Antonio Linares
Michel,

What do you use that loop for ?