GRID in HMG 3.4.4 - Unable to view (edit) MEMO field contents ?

Moderator: Rathinagiri

User avatar
Gilles
Posts: 2
Joined: Fri Jun 09, 2017 5:39 am
DBs Used: DBF
Location: Brussels, Belgium

GRID in HMG 3.4.4 - Unable to view (edit) MEMO field contents ?

Post by Gilles » Fri Jun 09, 2017 7:39 am

Hello,

I am a beginner in HMG, as I need to migrate an old DOS (yes really a DOS) application to Windows. I want to use HMG because I am too old to learn (nearly 60 now) OO programming and I feel good with old DBase III syntax.

I am using the GRID_25 sample of the HMG 3.4.4 distrib, the code in the demo.prg file was written by Roberto Lopez in 2009, perhaps things have changed a bit since and it was working then, but now when I launch the exe (the compilation works fine) and I click on the last (6th) field, which is a memo field (controlled by the GRID control

Code: Select all

aCtrl_6 := { 'EDITBOX' }
) then :
1. I type a sample text and save it
2. When I re-click on the same memo field, the changes seem not to be saved
3. I quit the program and go to view the DBF (TEST.DBF included in the "hmg.3.4.4\SAMPLES\Controls\Grid\GRID_25" folder) using LibreOffice Calc (which can smoothly open DBF files) I can clearly see that my changes HAVE BEEN SAVED
4. I restart the GRID_25\demo.exe and the memo field I modified (and just checked through LO-Calc) seems empty / does not show its contents.

Can someone tell me what I do wrong or what I would need to modify in the 2009 code of the GRID_25 sample to use it now with this version of HMG.

My OS : W10 Pro 64. Compile HMG in 32 bits.

I hope someone of the group can help me.

Another question : is there a book of recent HMG syntax and samples I could buy to teach me all the tricks about the commands and functions ? Samples are good and some pieces of code I find on Internet too but when I face such kind of difficulties I wish I could find a 'bible' of the language to help.

Apologies for any English mistakes, my native language is not English.


Gilles Maisonneuve.

PS: It might be clearer to insert screen copies but as I am a newbie here and don't know the policies about images I dare not doing so, as it might clutter up the site disk space with heavy data.

User avatar
Rathinagiri
Posts: 5166
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Has thanked: 129 times
Been thanked: 131 times
Contact:

Post by Rathinagiri » Fri Jun 09, 2017 8:36 am

Gilles Maisonneuve,

Wow! Great for a beginner. Sir, your English is better than mine.

What you have reported is a bug and thank you for reporting.

Now, you can do any of the following:

1. Plesae modify the line number 1133 of \hmg.3.4.4\source\h_grid.prg

from

Code: Select all

	     cTextFile:= GetDataGridCellData ( idx , .t. )
to

Code: Select all

	     cTextFile:= v  // GetDataGridCellData ( idx , .t. ) By Rathinagiri June 2017
and rebuild the library by running the batch file \hmg.3.4.4\buildlib32.bat

2. Download the updated library which is attached here and copy the same to \hmg.3.4.4\lib folder.
libhmg.zip
(506.05 KiB) Downloaded 34 times
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.

User avatar
serge_girard
Posts: 1838
Joined: Sun Nov 25, 2012 2:44 pm
DBs Used: 1 MySQL - MariaDB
2 DBF
Location: Belgium
Has thanked: 279 times
Been thanked: 63 times
Contact:

Post by serge_girard » Fri Jun 09, 2017 8:53 am

Gilles, soyez bienvenue !

Serge/Belgique

User avatar
serge_girard
Posts: 1838
Joined: Sun Nov 25, 2012 2:44 pm
DBs Used: 1 MySQL - MariaDB
2 DBF
Location: Belgium
Has thanked: 279 times
Been thanked: 63 times
Contact:

Post by serge_girard » Fri Jun 09, 2017 9:01 am

Gilles,

There is no book on HMG but we have documentation here: hmg.3.4.4/DOC/data/index.htm

You may insert coding/images by using the button Full Editor/Preview.
See also this topic: http://hmgforum.com/viewtopic.php?f=13 ... 640#p50640
Serge

huiyi_ch
Posts: 57
Joined: Sat May 21, 2016 5:27 am
Has thanked: 1 time
Been thanked: 7 times

Post by huiyi_ch » Fri Jun 09, 2017 11:31 am

Rathinagiri wrote:
Fri Jun 09, 2017 8:36 am
Gilles Maisonneuve,

Wow! Great for a beginner. Sir, your English is better than mine.

What you have reported is a bug and thank you for reporting.

Now, you can do any of the following:

1. Plesae modify the line number 1133 of \hmg.3.4.4\source\h_grid.prg

from

Code: Select all

	     cTextFile:= GetDataGridCellData ( idx , .t. )
to

Code: Select all

	     cTextFile:= v  // GetDataGridCellData ( idx , .t. ) By Rathinagiri June 2017
and rebuild the library by running the batch file \hmg.3.4.4\buildlib32.bat

2. Download the updated library which is attached here and copy the same to \hmg.3.4.4\lib folder.
libhmg.zip
Hello Rathinagiri
经过测试发现,您给出的解决方案不正确。当我们保存结果退出程序后,再启动程序,以前保存的结果仍然没有显示!
After testing found that the solution you give is not correct When we save the exit the program, then start the program, still did not show the results of previously saved

User avatar
Rathinagiri
Posts: 5166
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Has thanked: 129 times
Been thanked: 131 times
Contact:

Post by Rathinagiri » Fri Jun 09, 2017 11:34 am

Have you pressed Alt + S (File->Save pending session) to save the session?

Also I have updated the library after removing the debugging code.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.

huiyi_ch
Posts: 57
Joined: Sat May 21, 2016 5:27 am
Has thanked: 1 time
Been thanked: 7 times

Post by huiyi_ch » Fri Jun 09, 2017 12:01 pm

Rathinagiri wrote:
Fri Jun 09, 2017 11:34 am
Have you pressed Alt + S (File->Save pending session) to save the session?

Also I have updated the library after removing the debugging code.
Hello Rathinagiri,
对不起,我没有执行File->Save pending session,您是正确的!
I didn't execute File->Save pending session. You were right!

franco
Posts: 200
Joined: Sat Nov 02, 2013 5:42 am
DBs Used: DBF
Been thanked: 6 times

Post by franco » Fri Jun 09, 2017 11:00 pm

I am having a similar problem. In 3.2 worked fine but does not in 3.4.4. I have textboxes outside of grid. They do not update anymore.
I can not make them work at all. If I leave the grid the textbox in 3.2 would update from the table. In 3.4.4 it will not update. It is not linked to the table anymore. If I go to start of textbox and put msgbox(inventory->item) there is nothing there. end of file.
I have done the above but do not understand save. I have saved the prg file but if I go to alt+s it askes for file name should I replace it with same name. I also updated the lib file. :ugeek: I run independaent tables and ntx indexes.
Franco

User avatar
Gilles
Posts: 2
Joined: Fri Jun 09, 2017 5:39 am
DBs Used: DBF
Location: Brussels, Belgium

Post by Gilles » Sat Jun 10, 2017 1:48 am

Woaw Rathinagiri, you are my God! :)

As I am both lazy and a coward I choose option to download your fixed library and copy it in the lib folder after renaming the original.

After GRID-25 program recompiled, your bug fix worked perfectly for me, now I can see the memo (I save the memo using the "floppy disquette" icon at the bottom of the memo window, then the whole record changes using "file/save pending") each time I click on it.
Changes are saved from one run to another. Look :
hmg_grid_memofield_bugfix_20170609.jpg
Successful memo field view GRID for GRID_25 sample in hmg3.4.4
hmg_grid_memofield_bugfix_20170609.jpg (183.96 KiB) Viewed 606 times
Also I wish to express my thanks for all the nice answers from all the other members (how to insert an image for example and the link provided and the nice vidéo from Pablo César [muchísimas gracias a el también], et merci beaucoup à Serge pour son message de bienvenue, nous sommes voisins apparemment). It's a great confort to find such nice and dedicated people on that list for anew unskilled developer.

Thanks a lot to all of you.

Gilles

User avatar
Rathinagiri
Posts: 5166
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Has thanked: 129 times
Been thanked: 131 times
Contact:

Post by Rathinagiri » Sat Jun 10, 2017 3:08 am

You are welcome. :)

Franco, can you provide a KISS (Keep It Simple and Short) sample?
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.

Post Reply