FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour CURSOR question
Posts: 3022
Joined: Fri Oct 07, 2005 01:45 PM
CURSOR question
Posted: Fri Aug 07, 2015 06:00 PM

While preparing a report, I want to show the user the program is processing data. There are two ways:

1) Put the processing section in a separate function and use MessageWait( ) to show what is happening. I prefer not to do that if possible
2) Use CursorWait( ) and CursorArrow( ) in line to show that work is taking place. Unfortunately the CursorWait( ) function is not changing the cursor

Here are the steps:

1) Get initial input ( ie. dates )
2) CursorWait( )
3) Fill a temporary data file with information drawn from other files
4) CursorArrow( )
5) Create and display the report.

Step 2 just keeps showing the CursorArrow. Any thoughts on this ?

Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
Posts: 346
Joined: Mon Oct 05, 2009 03:35 PM
Re: CURSOR question
Posted: Sat Aug 08, 2015 01:17 PM
Tim:

mi experiencia con cursorwait(), cursorarrow()...

al utilizarlos como mencionas:
Code (fw): Select all Collapse
   cursorwait()
   oDbf  := oApp:oConnect:Query("SELECT LOTE,CSG,GPROD,ESPECIE,NOMESP,VARIEDAD,NOMVARI,SUM(BINS),SUM(TOTEMS),SUM(KNETOS) FROM LOTES WHERE GUIA='"+k+"' " )
   cursorarrow()


los procesos de consultas a querys en mysql eran demorosos, al sacarcos de los programas, las consultas mejoraron en mas de 150% en velocidad
asi que opté por sacarlos de todos los programas.

una idea, puedes utilizar:

Code (fw): Select all Collapse
MsgMeter( bAction, cMsg, cTitle )


para decirle al usuario lo que esta pasando en tus procesos


saludos
SkyPe: armando.lagunas@hotmail.com

Mail: armando.lagunas@gmail.com
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Re: CURSOR question
Posted: Sat Aug 08, 2015 03:08 PM

Tim,

1) Step 3 is calling cursorArrow() somewhere, directly or indirectly. To confirm this try changing your cursorArrow() to cursorHand() and then see if it changes back to an arrow.

If it does, then try searching your step 3 code, but it could be in Fivewin code, so you may need to comment out sections of Step 3 to try to isolate where it is happening. I always try to do a binary search thing, but commenting out half the code, then the other half. Then if you find which half, comment out half of it, and so on.

2) Maybe try adding a sysrefresh() right after CursorWait()

James

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 1096
Joined: Fri Oct 28, 2005 02:27 AM
Re: CURSOR question
Posted: Tue Aug 11, 2015 07:55 AM
James Bott wrote:
2) Maybe try adding a sysrefresh() right after CursorWait()


James, if I'm not mistaken a sysrefresh() will cancel out CursorWait(). It would be like calling CursorArrow(). In fact any update to the screen will cancel out CursorWait()
FWH 11.08/FWH 19.12

BCC5.82/BCC7.3

xHarbour/Harbour
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: CURSOR question
Posted: Tue Aug 11, 2015 08:23 AM

The right way to change the cursor is to assign it to the underlying window or dialog:

oWnd:oCursor = ...

Cursor...() functions are just for very short time processes

regards, saludos

Antonio Linares
www.fivetechsoft.com

Continue the discussion