Help with grid again

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

Post Reply
User avatar
Czarny_Pijar
Posts: 172
Joined: Thu Mar 18, 2010 11:31 pm
Location: 19.2341 E 50.2267 N

Help with grid again

Post 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?
Attachments
grid_ide_dbf.zip
(2.6 KiB) Downloaded 195 times
User avatar
Roberto Lopez
HMG Founder
Posts: 4023
Joined: Wed Jul 30, 2008 6:43 pm

Re: Help with grid again

Post 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"
Regards/Saludos,

Roberto


(Veritas Filia Temporis)
User avatar
Czarny_Pijar
Posts: 172
Joined: Thu Mar 18, 2010 11:31 pm
Location: 19.2341 E 50.2267 N

Re: Help with grid again

Post 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)
Attachments
grid_ide_dbf.zip
Corrected, but still not working sources
(2.6 KiB) Downloaded 175 times
err_grid_IDE.PNG
err_grid_IDE.PNG (10.35 KiB) Viewed 2580 times
User avatar
Roberto Lopez
HMG Founder
Posts: 4023
Joined: Wed Jul 30, 2008 6:43 pm

Re: Help with grid again

Post 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.
Regards/Saludos,

Roberto


(Veritas Filia Temporis)
User avatar
Roberto Lopez
HMG Founder
Posts: 4023
Joined: Wed Jul 30, 2008 6:43 pm

Re: Help with grid again

Post 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.
Regards/Saludos,

Roberto


(Veritas Filia Temporis)
User avatar
Roberto Lopez
HMG Founder
Posts: 4023
Joined: Wed Jul 30, 2008 6:43 pm

Re: Help with grid again

Post 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.
Regards/Saludos,

Roberto


(Veritas Filia Temporis)
Post Reply