Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Speeding up DoEvents()
Message
From
02/10/1998 00:14:36
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00142550
Message ID:
00143110
Views:
33
>David,
>
>
* FastDoEvents.prg 30-Sep-98
>
>* this workaround speeds up a DoEvent call
>
>local lnRow, lnCol, lcWindow
>
>lcWindow = wontop()
>lnRow = mrow( lcWindow )
>lnCol = mcol( lcWindow )
>if ( lnRow > 0 ) and ( lnCol > 0 )
>   * mouse still within VFP window, so it's ok to mouse
>   mouse at mrow(), mcol() window (lcWindow)
>endif
>
>DoEvents()
>
>So if you come up with any improvements/fixes to the above code I'd appreciate hearing about them.
>
Hi Frank,
The code works fine except where there's no wontop() so you need something like
Procedure DoEventsFast
local nRow, nCol, cWindow
cWindow= wontop()
nRow= mrow(m.cWindow)
nCol= mcol(m.cWindow)
if m.nRow>0 and m.nCol>0
	* mouse still inside VFP window, so ok to mouse
	if empty(m.cWindow)
		mouse at m.nRow, m.nCol 	&& window (m.cWindow)
	else
		mouse at m.nRow, m.nCol window (m.cWindow)
	endif
endif
doevents()
Now I've use m.nRow instead of another call to MROW(). Is that bad or good :-)
Regards
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform