Page 2 of 3

Re: HMG 3.0.28

Posted: Sat Apr 03, 2010 5:50 pm
by sudip
Hello Roberto,

I am facing problem regarding refresh method of grid. I compiled and ran some code with ver 3.0.27 without any problem. But it gives error with 3.0.28. I created a small sample to show the error. Please compile following code and run. Please click on "Calculate" button more than 2 or 3 times to see the problem.

Code: Select all

#include <hmg.ch>

REQUEST SQLMIX

Function Main()                       
   local adbf := {}
   local cCtrl := {"TEXTBOX", "CHARACTER"}, iCtrl := {"TEXTBOX", "NUMERIC", "999"}, nCtrl :=  {"TEXTBOX", "NUMERIC", "99999999.99"}                   
   private aData := {}

   set deleted on

   for i := 1 to 10
      aadd(aData, {'Emp '+ltrim(str(i)), i*1000.00})
   next
   
   aadd(adbf,  {"empnm",   "c",  40,   0})
   aadd(adbf,  {"basic",   "n",  10,   2})
   
   DBCREATE("salreg", adbf, "SQLMIX", .T., "salreg")
   

   DEFINE WINDOW salreg ;
      WIDTH 700             ;
      HEIGHT 550             ;
      TITLE "Grid Test" ;
      main

      DEFINE BUTTON Calc
         ROW    40
         COL    560
         WIDTH  120
         CAPTION "&Calculate"
         ACTION SalRegCalc()
      END BUTTON
         
      define grid grid_1
         row 70
         col 10
			WIDTH 670 
			HEIGHT 380
			HEADERS {'Employee','Basic'}
			WIDTHS {200,100}
			justify {0,1} 
			COLUMNCONTROLS {cCtrl,nCtrl} 
			ROWSOURCE "salreg"
			COLUMNFIELDS { 'empnm','basic'}
      end grid 
   END WINDOW
   
	salreg.Center
	salreg.Activate
Return Nil


static function SalRegCalc()
   
   select salreg
   delete all
   for i := 1 to len(aData)
      append blank
      replace empnm with aData[i, 1]
      replace basic with aData[i, 2]
   next
   
   salreg.Grid_1.Refresh                                            
   return nil
Problem is that, I tested the code with 3.0.27 and installed the app in my client's place, and today when I made a small change at client's place, I didn't check for the grid refresh method (it's my fault :( ) and after returning home, I noticed the error.

Most probably I made some mistakes in my code. :( But, when I compiled it with HMG 3.0.27 again, it worked fine :)

Thanks in advance :)

With best regards.

Sudip

Re: HMG 3.0.28

Posted: Wed Apr 07, 2010 8:33 am
by sudip
Hello All,

Did anyone check the problem I mentioned in previous post?

You may also download from
GridTest001.zip
(1.3 KiB) Downloaded 268 times
Thanks in advance :)

With best regards.

Sudip

Re: HMG 3.0.28

Posted: Wed Apr 07, 2010 8:49 am
by Rathinagiri
I too confirm the same Sudip.

I think Roberto would solve the problem in the next release.

Re: HMG 3.0.28

Posted: Wed Apr 07, 2010 9:00 am
by sudip
Thank you Friend :)
With best regards.
Sudip

Re: HMG 3.0.28

Posted: Thu Apr 08, 2010 8:19 am
by swapan
Dear Sudip:

Its perfectly alright in HMG 3.0.24 (2010.03.07) version.
Not yet installed this latest 3.0.28 though!

I think it will be not a major issue (as it is ok in previous versions), and would be resolved
with the next release, if there's no workaround for it in .28 version.

Re: HMG 3.0.28

Posted: Sat Apr 10, 2010 10:44 pm
by Roberto Lopez
sudip wrote:Hello All,

Did anyone check the problem I mentioned in previous post?

You may also download from
GridTest001.zip
Thanks in advance :)

With best regards.

Sudip
I'll review it ASAP.

Re: HMG 3.0.28

Posted: Sat Apr 10, 2010 10:51 pm
by Roberto Lopez
sudip wrote: Problem is that, I tested the code with 3.0.27 and installed the app in my client's place, and today when I made a small change at client's place, I didn't check for the grid refresh method (it's my fault :( ) and after returning home, I noticed the error.

Most probably I made some mistakes in my code. :( But, when I compiled it with HMG 3.0.27 again, it worked fine :)

Thanks in advance :)
Please, consider that data-bound grid is fully new code and thus, it could has some undiscovered problems.

Moreover, every time you fix something, there is a possibility that a new problem arises.

I'm doing my best.

Re: HMG 3.0.28

Posted: Sun Apr 11, 2010 4:21 am
by sudip
Roberto Lopez wrote:...
Please, consider that data-bound grid is fully new code and thus, it could has some undiscovered problems.

Moreover, every time you fix something, there is a possibility that a new problem arises.

I'm doing my best.
Yes Roberto :) Please continue the improvement of HMG in your time :)
For the time being I compiled my code into 3.0.27 and it is running fine :)

With best regards.

Sudip

Re: HMG 3.0.28

Posted: Sun Apr 11, 2010 5:18 am
by Rathinagiri
every time you fix something, there is a possibility that a new problem arises.
Then you don't fix that something. ;)

Haa haa. Just joking.

It is a nice Murphy's law:

A solution to a problem will be the root of a new problem.

Re: HMG 3.0.28

Posted: Sun Apr 11, 2010 1:24 pm
by Roberto Lopez
rathinagiri wrote:
every time you fix something, there is a possibility that a new problem arises.
Then you don't fix that something. ;)

Haa haa. Just joking.

It is a nice Murphy's law:

A solution to a problem will be the root of a new problem.
Data-bound grid is specially tricky and difficult because it works on a 'callback' basis.

This means that the OS calls the specified procedure when it 'needs' to repaint a specific cell.

I've already fixed all bugs reported about grid for 3.0.28, but I'll tag the next release as 'Test', since its 'sensitive nature'.