Page 1 of 1

Help with grid again

Posted: Thu May 06, 2010 10:58 pm
by Czarny_Pijar
This code

Code: Select all

#include <hmg.ch>

FUNCTION MAIN

  Use b1emp Shared        

   DEFINE WINDOW Form_1; 
                AT 0,0 ;
                WIDTH  330;
                HEIGHT 240;
                MAIN                                                                   
                                                            
		@ 10, 10 GRID Grid_1; 
			WIDTH 300; 
			HEIGHT 160;
			HEADERS {"No","Name"};
			WIDTHS  {140,150}; 
			ROWSOURCE "b1emp" ;                          
			VALUE { 1 , 1 } ;
			COLUMNCONTROLS {{'TEXTBOX','NUMERIC','9999'},{'TEXTBOX','CHARACTER'}};
			COLUMNFIELDS {'emp_no','emp_name'}               
                                                        
   END WINDOW      
   
   CENTER WINDOW Form_1
   ACTIVATE WINDOW Form_1
RETURN
works as expected.

I have been trying do the same things with IDE (see the attachment). I've checked everything twice, and now I wonder, it is a bug or my subsequent eclipse?

Re: Help with grid again

Posted: Fri May 07, 2010 1:52 am
by Roberto Lopez
Czarny_Pijar wrote:This code

Code: Select all

#include <hmg.ch>

FUNCTION MAIN

  Use b1emp Shared        

   DEFINE WINDOW Form_1; 
                AT 0,0 ;
                WIDTH  330;
                HEIGHT 240;
                MAIN                                                                   
                                                            
		@ 10, 10 GRID Grid_1; 
			WIDTH 300; 
			HEIGHT 160;
			HEADERS {"No","Name"};
			WIDTHS  {140,150}; 
			ROWSOURCE "b1emp" ;                          
			VALUE { 1 , 1 } ;
			COLUMNCONTROLS {{'TEXTBOX','NUMERIC','9999'},{'TEXTBOX','CHARACTER'}};
			COLUMNFIELDS {'emp_no','emp_name'}               
                                                        
   END WINDOW      
   
   CENTER WINDOW Form_1
   ACTIVATE WINDOW Form_1
RETURN
works as expected.

I have been trying do the same things with IDE (see the attachment). I've checked everything twice, and now I wonder, it is a bug or my subsequent eclipse?
In main.fng, the rowsource line has an extra single quote. Please, correct it and try again.

Code: Select all

ROWSOURCE "'b1emp"

Re: Help with grid again

Posted: Fri May 07, 2010 8:28 am
by Czarny_Pijar
Roberto Lopez wrote:In main.fng, the rowsource line has an extra single quote. Please, correct it and try again.

Code: Select all

ROWSOURCE "'b1emp"
Yes, this type of errors I hate most. As we can see, these days, when I can live without glasses, pass away forever.

Unfortunately, correct this error did not help, still the same error pops up.
Error DBCMD/2001 Workarea not in use: DBEVAL
Called from DBEVAL(0)
Called from GETDATAGRIDRECCOUNT(2651)
Called from _DEFINEGRID(139)
Called from MAIN(54)
================== Edit =================

This information was taken from a previous version, HMG 3.0.31. In the current version 3.0.32 this is changed slightly:
Error DBCMD/2001 Workarea not in use: DBEVAL
Called from DBEVAL(0)
Called from GETDATAGRIDRECCOUNT(2644)
Called from _DEFINEGRID(139)
Called from MAIN(54)

Re: Help with grid again

Posted: Fri May 07, 2010 2:10 pm
by Roberto Lopez
Czarny_Pijar wrote:
Roberto Lopez wrote:In main.fng, the rowsource line has an extra single quote. Please, correct it and try again.

Code: Select all

ROWSOURCE "'b1emp"
Yes, this type of errors I hate most. As we can see, these days, when I can live without glasses, pass away forever.

Unfortunately, correct this error did not help, still the same error pops up.
Ok. I'll check it again.

Re: Help with grid again

Posted: Sun May 09, 2010 10:51 pm
by Roberto Lopez
Roberto Lopez wrote:
Czarny_Pijar wrote:
Roberto Lopez wrote:In main.fng, the rowsource line has an extra single quote. Please, correct it and try again.

Code: Select all

ROWSOURCE "'b1emp"
Yes, this type of errors I hate most. As we can see, these days, when I can live without glasses, pass away forever.

Unfortunately, correct this error did not help, still the same error pops up.
Ok. I'll check it again.
The problem is not really related with IDE.

In fact the two samples are different, since, in the first you open the table before creating the grid and in the other the table is opened in the OnInit procedure.

The true problem is that the grid definition procedure requires that the table be already open.

Re: Help with grid again

Posted: Sun May 09, 2010 11:52 pm
by Roberto Lopez
Roberto Lopez wrote: The true problem is that the grid definition procedure requires that the table be already open.
I'll add a notice about this in documentation and appropriate error checking at Grid definition.