CURSOR question

CURSOR question

Postby TimStone » Fri Aug 07, 2015 6: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
User avatar
TimStone
 
Posts: 2905
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA

Re: CURSOR question

Postby armando.lagunas » Sat Aug 08, 2015 1:17 pm

Tim:

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

al utilizarlos como mencionas:
Code: Select all  Expand view

   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: Select all  Expand view

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
User avatar
armando.lagunas
 
Posts: 346
Joined: Mon Oct 05, 2009 3:35 pm
Location: Curico-Chile

Re: CURSOR question

Postby James Bott » Sat Aug 08, 2015 3: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
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: CURSOR question

Postby hua » Tue Aug 11, 2015 7: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
hua
 
Posts: 1047
Joined: Fri Oct 28, 2005 2:27 am

Re: CURSOR question

Postby Antonio Linares » Tue Aug 11, 2015 8: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
User avatar
Antonio Linares
Site Admin
 
Posts: 41366
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 30 guests