Page 3 of 4

Re: GRID : problem with delete and refresh

Posted: Sat Apr 16, 2016 10:24 pm
by apais
I hope someone more capable than me can review this point.
The very nature of an open source and voluntary product like HMG makes that people work on it if/when they can and are willing to.
I was only trying to point that browse is more capable than grid to manage live data.
At least this is my personal experience.
Of course any core developer can, and surely will prove me wrong.

Re: GRID : problem with delete and refresh

Posted: Sat Apr 30, 2016 2:11 pm
by TopsMarc
Thank you Claudio for fixing my issue with the GRID.VALUE property.
Could you also take a look please at the GRID.RECNO property I posted in april ? Play the movie GridRecNo from attachment.
On the left side I have a grid control, on the right side a browse control. Both use the same workarea with 3 records BEF, EUR and NLG.
Delete the first record (BEF) in the grid or the browse. Both grid and browse are ok.
Delete again the first record (EUR) in the grid or the browse.
The browse shows the NLG-record and is ok, but the grid shows again the EUR-record and that is not ok.
Pushing the refresh button doesn't change anything.
Another developer also wrote there is obviously some kind of navigation error in the grid. Could you fix this GRID.RECNO property too please ?

Kind regards, Marc

Re: GRID : problem with delete and refresh

Posted: Sat Apr 30, 2016 5:57 pm
by srvet_claudio
TopsMarc wrote:Thank you Claudio for fixing my issue with the GRID.VALUE property.
Could you also take a look please at the GRID.RECNO property I posted in april ? Play the movie GridRecNo from attachment.
On the left side I have a grid control, on the right side a browse control. Both use the same workarea with 3 records BEF, EUR and NLG.
Delete the first record (BEF) in the grid or the browse. Both grid and browse are ok.
Delete again the first record (EUR) in the grid or the browse.
The browse shows the NLG-record and is ok, but the grid shows again the EUR-record and that is not ok.
Pushing the refresh button doesn't change anything.
Another developer also wrote there is obviously some kind of navigation error in the grid. Could you fix this GRID.RECNO property too please ?

Kind regards, Marc
Is not a bug, change your KR_Button_Del_Grid() function for this and see comments:

Code: Select all

FUNCTION KR_Button_Del_Grid()

// this is redundant, see:
Msgdebug( Win_KR.KR_Grid_KR.RecNo )
VM->(DBGoto( Win_KR.KR_Grid_KR.RecNo ))
Msgdebug( Win_KR.KR_Grid_KR.RecNo )

   // GRID with DataBase works with internal data buffer for Delete, Recall and Append records
   
   Win_KR.KR_Grid_KR.Delete   // marks the current record for deletion
   Win_KR.KR_Grid_KR.Save     // execute pending operations and update internal buffer, in this case delete record( DBDelete() )

   // DeleteRec()

	Win_KR.KR_Browse_KR.Value := VM->(recno())
	Win_KR.KR_Browse_KR.Refresh
	
   // Win_KR.KR_Grid_KR.RecNo := VM->(recno())
   // Win_KR.KR_Grid_KR.Refresh
   
	Win_KR.KR_Grid_KR.Setfocus
RETURN

Re: GRID : problem with delete and refresh

Posted: Sat Apr 30, 2016 8:01 pm
by TopsMarc
Hi Claudio,

I understand what you are saying, but even with the .delete and .save method, the result is the same as before. Please look at my new video GridRecno_V02 in attachment.
This time I recorded the program while debugging, so you can see I did the modifications as you said. Am I doing something wrong ?

I appreciate your help. Kind regards, Marc

Re: GRID : problem with delete and refresh

Posted: Sat Apr 30, 2016 8:20 pm
by srvet_claudio
TopsMarc wrote:Hi Claudio,

I understand what you are saying, but even with the .delete and .save method, the result is the same as before. Please look at my new video GridRecno_V02 in attachment.
This time I recorded the program while debugging, so you can see I did the modifications as you said. Am I doing something wrong ?

I appreciate your help. Kind regards, Marc
Please, test with my .exe file.

Re: GRID : problem with delete and refresh

Posted: Sat Apr 30, 2016 9:42 pm
by TopsMarc
Hi Claudio,

When I run your EXE-file, the program works fine.
When I recompile just now without changing anything in your sources, I get again a bad GRID result.
I really don't understand that. I use Windows 10 Home, HMG 3.4.2.
I removed HMG and reinstalled HMG 3.4.2 yesterday. It didn't help. I tried installed hmg.3.4.2_patch_4 this morning too. That didn't help either for this issue. I always get a bad GRID result.
How is it possible that your compiled version works fine, and mine not ?
HMG is installed here in folder C:\HMG\ and not in c:\hmg.3.4.2\ I suppose that can't hurt ?

Kind regards, Marc

Re: GRID : problem with delete and refresh

Posted: Sat Apr 30, 2016 10:28 pm
by srvet_claudio
TopsMarc wrote:Hi Claudio,

When I run your EXE-file, the program works fine.
When I recompile just now without changing anything in your sources, I get again a bad GRID result.
I really don't understand that. I use Windows 10 Home, HMG 3.4.2.
I removed HMG and reinstalled HMG 3.4.2 yesterday. It didn't help. I tried installed hmg.3.4.2_patch_4 this morning too. That didn't help either for this issue. I always get a bad GRID result.
How is it possible that your compiled version works fine, and mine not ?
HMG is installed here in folder C:\HMG\ and not in c:\hmg.3.4.2\ I suppose that can't hurt ?

Kind regards, Marc
Try with this:
1) unzip attachment in your HMG folder
2) recompile my demo

Re: GRID : problem with delete and refresh

Posted: Sat Apr 30, 2016 11:09 pm
by TopsMarc
Hi Claudio, you are a genius !

I replaced my folder C:\HMG\LIB with yours, I recompiled the program, and now the GRID is ok.
I don't know why my libraries were not good, but I am very happy that they are now. I will redo other experiments with the GRID next few weeks.

Many many thanks.
Kind regards, Marc

Re: GRID : problem with delete and refresh

Posted: Sun May 01, 2016 12:58 am
by esgici
TopsMarc wrote:Hi Claudio, you are a genius !
...
Many many thanks.
Kind regards, Marc
+1

Re: GRID : problem with delete and refresh

Posted: Mon May 02, 2016 8:43 pm
by TopsMarc
Hi Claudio,

I am sorry to bother you again about the grid. But I am still frustrated by the grid.
Let's take a look again at the program you compiled for me with the .delete and .save method.
Please play my movie GridDeleteKeyboard in attachment.
I see strange things when I use the arrow keys on my keyboard to navigate the grid. Is that on your computer too ?

Kind regards, Marc