Page 1 of 2
GRID : an error in property "value" ?
Posted: Tue Apr 19, 2016 4:53 pm
by TopsMarc
Hi everybody.
Today I experimented with the grid, and created a program to save provinces.
Please see the movie GridValueProperty I recorded in attachment. Included also the program source and database.
The program shows the grid property "value" in a messagebox.
When there are 2 records in the database, I delete the second record. Is there then an error in the grid property "value" ?
The grid row remains 2, even when I select the first row.
(And is there a problem with the coloring ? I use cell navigation, but the whole line turns blue since then).
Kind regards, Marc
Re: GRID : an error in property "value" ?
Posted: Wed Apr 20, 2016 7:57 am
by dragancesu
Code: Select all
*------------------------------------------------------------------------------*
FUNCTION PRV_Button_Delete()
*------------------------------------------------------------------------------*
LOCAL aRC := Win_PRV.Grid_PRV.Value
LOCAL aItem := Win_PRV.Grid_PRV.Item(aRC[1])
IF PRV->(DBSeek( aItem[1] + aItem[2] ))
IF MsgOkCancel ("Delete " + aItem[2] + " " + ALLTRIM(aItem[3]), "Controle")
PRV->(DBDelete())
PRV->(DBUnlock())
PRV->(DBSkip())
IF PRV->(EOF())
PRV->(DBGobottom())
ENDIF
Win_PRV.Grid_PRV.DeleteItem( aRC[1] )
??? Win_PRV.Grid_PRV.Value := { aRC[1], aRC[2] }
*IF aRC[1] > Win_PRV.Grid_PRV.ItemCount
* IF Win_PRV.Grid_PRV.ItemCount > 0
* aRC[1] := Win_PRV.Grid_PRV.ItemCount
* ENDIF
*ENDIF
ENDIF
ENDIF
PRV_RefreshData()
Win_PRV.Grid_PRV.Setfocus
RETURN
Your program is good or pay attention to unnecessary things fashion errors or are not significant
I do not know how long a programmer, I have long used the clipper, then I found harbour and was thrilled when I started I HMG again I was at the beginning and it took me a few months to adjust, windows programming is a little different than for dos
As long as you have experience with programming when you go with the new man is a beginner (like him or not), and it must also be set to pass the cases where there are plenty of HMG
You may want to write your previous experience with programming
p.s. forget refresh button, create a function that solve after actions that seek to
Re: GRID : an error in property "value" ?
Posted: Wed Apr 20, 2016 5:02 pm
by TopsMarc
The program is now modified to avoid the error in the grid property "value". See the latest attachment PRV.ZIP.
If anybody has any remarks on things that could be better, please let me know. I know Clipper (DOS, TBrowse), but I am a HMG-IDE beginner.
I do hope that the HMG development team will handle the issue I demonstrated in the movie GridValuePropery I posted earlier.
To the HMG team I would like to say you are doing a great job and make many programmers all over the world very happy.
Keep up the good work
Kind regards, Marc
Re: GRID : an error in property "value" ?
Posted: Thu Apr 21, 2016 7:08 am
by serge_girard
Very nice and you will become a real HMG-man!
Serge
Re: GRID : an error in property "value" ?
Posted: Thu Apr 21, 2016 8:52 am
by bpd2000
serge_girard wrote:Very nice and you will become a real HMG-man!
Serge
+1
Re: GRID : an error in property "value" ?
Posted: Thu Apr 21, 2016 4:57 pm
by gfilatov
TopsMarc wrote:The program is now modified to avoid the error in the grid property "value". See the latest attachment PRV.ZIP.
If anybody has any remarks on things that could be better, please let me know. I know Clipper (DOS, TBrowse), but I am a HMG-IDE beginner.
...
Kind regards, Marc
Hi Marc,
Thanks for your sample
I've adapted this example to a recent build of Minigui Extended Edition 16.04 with a small improvements
Please take a look for an attached code with the proposed modifications.
Re: GRID : an error in property "value" ?
Posted: Thu Apr 21, 2016 9:15 pm
by TopsMarc
Thank you all for your support. I am learning and all help is welcome.
Hi Grigory, you did some fine modifications. I like it

. I do get syntax errors when I try to compile your MiniGui modifications in HMG-IDE, e.g. .SetArray is invalid. Some things seem to be different in MiniGui compared to HMG-IDE. I read about Harbour, xHarbour, MiniGui, HMG, HMG-IDE, HwGui, ooHG and similar. I didn't really know what to choose. But HMG-IDE was very well documented, so I chose that one.
Is there a special reason why you use MiniGui ? Has MiniGui advantages compared to HMG-IDE ?
If there is a bug in e.g. the GRID in HMG-IDE, is the same bug then present in MiniGui or not ? Are bugs quickly repaired by the development team in MiniGui ? I do have a lot of questions
Kind regards, Marc
Re: GRID : an error in property "value" ?
Posted: Fri Apr 22, 2016 7:43 am
by gfilatov
TopsMarc wrote:Thank you all for your support. I am learning and all help is welcome.
Hi Grigory, you did some fine modifications. I like it

. I do get syntax errors when I try to compile your MiniGui modifications in HMG-IDE, e.g. .SetArray is invalid. Some things seem to be different in MiniGui compared to HMG-IDE. I read about Harbour, xHarbour, MiniGui, HMG, HMG-IDE, HwGui, ooHG and similar. I didn't really know what to choose. But HMG-IDE was very well documented, so I chose that one.
Is there a special reason why you use MiniGui ? Has MiniGui advantages compared to HMG-IDE ?
If there is a bug in e.g. the GRID in HMG-IDE, is the same bug then present in MiniGui or not ? Are bugs quickly repaired by the development team in MiniGui ? I do have a lot of questions
Hi Marc,
Thanks for your interest!
You can read about MiniguiEx on this forum at
http://hmgforum.com/viewtopic.php?f=5&t ... cial#p1319
The Minigui Team provide a new builds on the
monthly basis for BCC, mingw32 and mingw64 C-compilers.
BTW I don't use any IDE personally but a free coding only
Sorry I can not promote the MiniguiEx project on this
friendly forum

Re: GRID : an error in property "value" ?
Posted: Sat Apr 23, 2016 11:38 pm
by srvet_claudio
TopsMarc wrote:Hi everybody.
Today I experimented with the grid, and created a program to save provinces.
Please see the movie GridValueProperty I recorded in attachment. Included also the program source and database.
The program shows the grid property "value" in a messagebox.
When there are 2 records in the database, I delete the second record. Is there then an error in the grid property "value" ?
The grid row remains 2, even when I select the first row.
(And is there a problem with the coloring ? I use cell navigation, but the whole line turns blue since then).
Kind regards, Marc
Hi Mark,
this is the correct way:
Code: Select all
*------------------------------------------------------------------------------*
FUNCTION PRV_Button_Delete()
*------------------------------------------------------------------------------*
LOCAL aRC := Win_PRV.Grid_PRV.Value
LOCAL aItem := Win_PRV.Grid_PRV.Item(aRC[1])
IF PRV->(DBSeek( aItem[1] + aItem[2] ))
IF MsgOkCancel ("Delete " + aItem[2] + " " + ALLTRIM(aItem[3]), "Controle")
PRV->(DBDelete())
PRV->(DBUnlock())
PRV->(DBSkip())
IF PRV->(EOF())
PRV->(DBGobottom())
ENDIF
Win_PRV.Grid_PRV.DeleteItem( aRC[1] )
// Win_PRV.Grid_PRV.Value := { aRC[1], aRC[2] } --> assigns a wrong value when delete the last item
IF aRC[1] > Win_PRV.Grid_PRV.ItemCount
IF Win_PRV.Grid_PRV.ItemCount > 0
aRC[1] := Win_PRV.Grid_PRV.ItemCount
Win_PRV.Grid_PRV.Value := { aRC[1], aRC[2] }
ENDIF
ENDIF
ENDIF
ENDIF
PRV_RefreshData()
Win_PRV.Grid_PRV.Setfocus
RETURN
Re: GRID : an error in property "value" ?
Posted: Sun Apr 24, 2016 8:31 pm
by srvet_claudio
I have fixed the problem in updating the Value property when an item is deleted in the Grid control.
Thanks for report Marc.