GRID : Bug in refresh ?

Moderator: Rathinagiri

Post Reply
User avatar
TopsMarc
Posts: 80
Joined: Wed Apr 06, 2016 5:57 am
Location: Belgium (Flanders)

GRID : Bug in refresh ?

Post by TopsMarc »

Hi,

In my program ART there is a MSGDEBUG(...) in the function ART_NewArtID(). I compile and run the program.
I click in the GRID. Remember the record.
Click button ADD, click button REFRESH.
The current record in the GRID is the same as before I clicked the buttons.

Now I remove the MSGDEBUG(...) in program ART, compile and run the program again. I repeat the same actions.
I click in the GRID. Remember the record.
Click button ADD, click button REFRESH.
The current record in the GRID is NOT the same as before I clicked the buttons.
How is that possible ? Is there a bug in the GRID refresh ? Why is the GRID result incorrect without the MSGDEBUG(...) in the program ?
I don't get it.

You can see it too in the movie GridRefresh in attachment.

(Any remarks about the program, good or bad, are welcome too. I want to learn).

Kind regards, Marc
Attachments
GridRefresh.zip
(5.75 MiB) Downloaded 236 times
ART.zip
(1.55 MiB) Downloaded 236 times
User avatar
srvet_claudio
Posts: 2193
Joined: Thu Feb 25, 2010 8:43 pm
Location: Uruguay
Contact:

Re: GRID : Bug in refresh ?

Post by srvet_claudio »

Hi Marc,
see this changes:

Code: Select all

*------------------------------------------------------------------------------*
FUNCTION ART_RefreshScreen()
*------------------------------------------------------------------------------*
	LOCAL nRecno := Win_ART_GRID.Grid_ART.RecNo    // ART->(recno())

   msgdebug(Win_ART_GRID.Grid_ART.RecNo,  ART->(recno()), nRecno_ART)

	Win_ART_GRID.Grid_ART.Refresh 
	Win_ART_GRID.Grid_ART.RecNo := nRecno
	Win_ART_GRID.Grid_ART.Setfocus
	ART_RefreshData()
RETURN
Best regards.
Dr. Claudio Soto
(from Uruguay)
http://srvet.blogspot.com
User avatar
TopsMarc
Posts: 80
Joined: Wed Apr 06, 2016 5:57 am
Location: Belgium (Flanders)

Re: GRID : Bug in refresh ?

Post by TopsMarc »

Hi Claudio,

Your MSGDEBUG helps me to prove there is something weird.

Let us do your changes, but also keep my MSGDEBUG in the function ART_NewArtID, compile and run.
Click on a record in the grid, click the add button, click the refresh button.
Your MSGDEBUG in function ART_Refreshscreen will show that Win_ART_Grid.Grid_ART.RecNo and nRecno_ART and ART->(recno()) are the same, as it should be.

Now keep your MSGDEBUG, but remove my MSGDEBUG in the function ART_NewArtID, compile and run again.
Click on a record in the grid, click the add button, click the refresh button.
Your MSGDEBUG in ART_Refreshscreen will show that ART->(recno()) is NOT the same anymore as Win_ART_Grid.Grid_ART.RecNo and nRecno_ART.
Why is that ? That is illogically, isn't it ? Therefore I think it is a bug.

Kind regards, Marc
Post Reply