Understanding Grids and Indices

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

Jeff Stone
Posts: 44
Joined: Fri Jun 20, 2014 8:41 pm

Re: Understanding Grids and Indices

Post by Jeff Stone »

Hi Andres,

You need to continue through the first Go Bottom messagebox as the program next does a SKIP 1. When I run with the Checkbox checked, I then get the following:
Checked.JPG
Checked.JPG (70.48 KiB) Viewed 3719 times
If I run with the Checkbox unchecked, I get:
UnChecked.JPG
UnChecked.JPG (71.08 KiB) Viewed 3719 times
Are you getting the same display in both instances?

Many thanks in advance,

Jeff
Jeff Stone
Posts: 44
Joined: Fri Jun 20, 2014 8:41 pm

Re: Understanding Grids and Indices

Post by Jeff Stone »

Hi Serge,

Proceed1fp.prg is only needed for VFP compilations. It is not listed in the GRID_Issue.hbp and isn't needed to compile with HMG-IDE. Are you getting some kind of error message saying you need it?

Thanks for assisting.

Jeff
User avatar
andyglezl
Posts: 1461
Joined: Fri Oct 26, 2012 7:58 pm
Location: Guadalajara Jalisco, MX
Contact:

Re: Understanding Grids and Indices

Post by andyglezl »

Lo siento, sin conocer todo el panorama de lo que tu quieres hacer, es dificil buscar el problema...
Por ejemplo, tu defines el GRID con las siguientes propiedades: ALLOWEDIT .F., ALLOWAPPEND .F., ALLOWDELETE .F.
entonces que caso tiene el poner ChoseCtw.GRID_1.Enabled := X el cual te causa problemas ?
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Sorry, not knowing the whole picture of what you want to do, it is difficult find the problem ...
For example, you define the GRID with the following properties: AllowEdit .F, ALLOWAPPEND .F, AllowDelete .F.
then that case has put ChoseCtw.GRID_1.Enabled: = X which causes you problems?

O tal vez sea un "Bug"...
----------------------------
or maybe it is a "Bug" ...
Andrés González López
Desde Guadalajara, Jalisco. México.
Jeff Stone
Posts: 44
Joined: Fri Jun 20, 2014 8:41 pm

Re: Understanding Grids and Indices

Post by Jeff Stone »

The purpose of the Grid is to allow users to select which records they want to process. Our full code for the page allows the user to double click on the leftmost column to check or uncheck the record but I removed it as it was not necessary. When the user clicks on the "OK" button, processing begins on the records that are checked (02.bmp). When done processing the checked records, we force a GO BOTTOM so that a subsequent SKIP 1 will cause an EOF result and the routine will exit the process loop. The problem we encountered was the SKIP 1 was not taking us to EOF if GRID_1 was still ENABLED. However, when GRID_1 was not ENABLED, there is no problem.

I am trying to get confirmation that someone else can compile our code sample and see the same strange behavior that we are seeing. I originally thought the issue had something to do with the index, but commenting out line 110:
index on upper(long_name) +upper(dealname) to (userlist)
made no difference. However, I cannot understand how GO BOTTOM then SKIP 1 can give anything but EOF; however, when GRID_1 is ENABLED, we do not get EOF.

This is very confusing.
User avatar
andyglezl
Posts: 1461
Joined: Fri Oct 26, 2012 7:58 pm
Location: Guadalajara Jalisco, MX
Contact:

Re: Understanding Grids and Indices

Post by andyglezl »

Según lo que entendí, YO lo haría de la siguiente manera:
Crear 2 GRIDs, en el primero mostrar los registros del archivo para seleccionar los necesarios.
cuando den doble click, añadirlo al segundo GRID el cual contendrá los registros seleccionados
con los cuales se haría el proceso deseado, ya sea con la info contenida en el GRID2 ó haciendo
un SEEK al archivo si hay mas campos que procesar...
----------------------------------------------------------------------------------------------------------------
As I understand, I would do the following:
Create 2 grids, in the first display file records needed to select.
when they give double click, add it to the second GRID which contain the selected records
with which the desired process would, either, with the info contained in the GRID2 or doing
a Seek to file if there are more fields to be processed ...
Andrés González López
Desde Guadalajara, Jalisco. México.
User avatar
serge_girard
Posts: 3167
Joined: Sun Nov 25, 2012 2:44 pm
DBs Used: 1 MySQL - MariaDB
2 DBF
Location: Belgium
Contact:

Re: Understanding Grids and Indices

Post by serge_girard »

Jeff ,

I managed to compile with 3.4.0 and no problems....
I put these commands inbetween your code:

Code: Select all

....your code
index on upper(long_name) + upper(dealname) to (userlist)
  
SET PRINTER TO test.TXT 
SET PRINTER ON 
SET CONSOLE OFF
go bottom
do while .not. eof()
   ? str(recno(),3) + ' ' + long_name  +  ' ' + dealname + ' ' + iif(eof(), 'EOF', 'Not EOF')
   skip 1
enddo
SET PRINTER TO  
SET PRINTER Off
SET CONSOLE On

go bottom
.... your code
Which gives this: 57 CWMBS, Inc.,2004-8 G2 B0408 Not EOF

I can be a bug in 3.4.2
Please try in 3.4.0

Greatings, Serge
There's nothing you can do that can't be done...
Jeff Stone
Posts: 44
Joined: Fri Jun 20, 2014 8:41 pm

Re: Understanding Grids and Indices

Post by Jeff Stone »

Hi Serge,

Your idea was a good one. Unfortunately, I tried 3.4.0 and got the same results. Could you send me your .exe? I want to confirm that it has nothing to do with my PC/environment.

Thanks,

Jeff
User avatar
serge_girard
Posts: 3167
Joined: Sun Nov 25, 2012 2:44 pm
DBs Used: 1 MySQL - MariaDB
2 DBF
Location: Belgium
Contact:

Re: Understanding Grids and Indices

Post by serge_girard »

Jeff,

Send me your emailaddress via private message.

Serge
There's nothing you can do that can't be done...
Jeff Stone
Posts: 44
Joined: Fri Jun 20, 2014 8:41 pm

Re: Understanding Grids and Indices

Post by Jeff Stone »

Hi Serge,

I finally got a chance to run your .exe, and it ran fine in terms of going from the BOTTOM of the file and skipping to EOF(). However, the display was weird as all of First Pay dates displayed as "P" as did some of the Deal Names:
Serge_exe.JPG
Serge_exe.JPG (78.77 KiB) Viewed 3578 times
Did it display the same way for you? Here is the way my .exe displays:
Jeff_exe.JPG
Jeff_exe.JPG (89.11 KiB) Viewed 3578 times
Thanks again for you help.

Jeff
User avatar
serge_girard
Posts: 3167
Joined: Sun Nov 25, 2012 2:44 pm
DBs Used: 1 MySQL - MariaDB
2 DBF
Location: Belgium
Contact:

Re: Understanding Grids and Indices

Post by serge_girard »

Jeff, This is very strange... Sometimes it does and sometimes it doesn't...
Even with scrolling up and down and after closing and rerunning.

I take a look at it later.

Greetings, Serge
There's nothing you can do that can't be done...
Post Reply