MEM file issue

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

Paramvir
Posts: 44
Joined: Sun Mar 27, 2016 9:46 am
Location: India
Contact:

MEM file issue

Post by Paramvir »

Hello

It looks .MEM file cannot store the full variable name if it exceeds 10 characters. It truncates the remaining characters and keeps only the first 10 characters. Any solution or workaround will be helpful.

Thank you all

Paramvir
User avatar
dragancesu
Posts: 921
Joined: Mon Jun 24, 2013 11:53 am
DBs Used: DBF, MySQL, Oracle
Location: Subotica, Serbia

Re: MEM file issue

Post by dragancesu »

Search BEGIN INI in samples
if !File("Config.ini")
Begin ini file ("Config.ini")
Set Section "CONFIGURATIONS" ENTRY "Port" To c_Port
Set Section "CONFIGURATIONS" ENTRY "Path" To c_Path
End ini
else
Begin ini file ("Config.ini")
Get c_Port Section "CONFIGURATIONS" ENTRY "Port"
Get c_Path Section "CONFIGURATIONS" ENTRY "Path"
End Ini
endif
User avatar
gfilatov
Posts: 1067
Joined: Fri Aug 01, 2008 5:42 am
Location: Ukraine
Contact:

Re: MEM file issue

Post by gfilatov »

Paramvir wrote: Mon Aug 17, 2020 7:04 am Hello

It looks .MEM file cannot store the full variable name if it exceeds 10 characters. It truncates the remaining characters and keeps only the first 10 characters. Any solution or workaround will be helpful.
Hello Paramvir,

Please be so kind to use the following Harbour native commands
#command RESTORE HBV [FROM <(f)>] [<a:ADDITIVE>]
#command SAVE HBV TO <(f)> ALL LIKE <p>
#command SAVE HBV ALL LIKE <p> TO <(f)>
#command SAVE HBV ALL EXCEPT <p> TO <(f)>
#command SAVE HBV TO <(f)> ALL EXCEPT <p>
#command SAVE HBV [TO <(f)>] [ALL]
and save your variables to .hbv file. :idea:

This file format supports long variable names and much larger amount of data then Clipper compatible .mem files. :arrow:
Kind Regards,
Grigory Filatov

"Everything should be made as simple as possible, but no simpler." Albert Einstein
Paramvir
Posts: 44
Joined: Sun Mar 27, 2016 9:46 am
Location: India
Contact:

Re: MEM file issue

Post by Paramvir »

gfilatov wrote: Mon Aug 17, 2020 9:02 am
Paramvir wrote: Mon Aug 17, 2020 7:04 am Hello

It looks .MEM file cannot store the full variable name if it exceeds 10 characters. It truncates the remaining characters and keeps only the first 10 characters. Any solution or workaround will be helpful.
Hello Paramvir,

Please be so kind to use the following Harbour native commands
#command RESTORE HBV [FROM <(f)>] [<a:ADDITIVE>]
#command SAVE HBV TO <(f)> ALL LIKE <p>
#command SAVE HBV ALL LIKE <p> TO <(f)>
#command SAVE HBV ALL EXCEPT <p> TO <(f)>
#command SAVE HBV TO <(f)> ALL EXCEPT <p>
#command SAVE HBV [TO <(f)>] [ALL]
and save your variables to .hbv file. :idea:

This file format supports long variable names and much larger amount of data then Clipper compatible .mem files. :arrow:
Thank you Gfilatov. This is what I was looking for. Great! Thank you once again.

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

Re: MEM file issue

Post by serge_girard »

Hi Gregory,

Missing => somewhere?

Serge
There's nothing you can do that can't be done...
RPC
Posts: 285
Joined: Fri Feb 10, 2017 4:12 am
DBs Used: DBF

Re: MEM file issue

Post by RPC »

gfilatov wrote: Mon Aug 17, 2020 9:02 am
Please be so kind to use the following Harbour native commands
#command RESTORE HBV [FROM <(f)>] [<a:ADDITIVE>]
#command SAVE HBV TO <(f)> ALL LIKE <p>
#command SAVE HBV ALL LIKE <p> TO <(f)>
#command SAVE HBV ALL EXCEPT <p> TO <(f)>
#command SAVE HBV TO <(f)> ALL EXCEPT <p>
#command SAVE HBV [TO <(f)>] [ALL]
and save your variables to .hbv file. :idea:

This file format supports long variable names and much larger amount of data then Clipper compatible .mem files. :arrow:
Hi Gregory
Thanks for the code.
As Serge pointed => seems to be missing.
Can you provide some working example ?
User avatar
AUGE_OHR
Posts: 2062
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany

Re: MEM file issue

Post by AUGE_OHR »

hi,

found in c:\hmg.3.4.4\HARBOUR\include\std.ch

Code: Select all

#command RESTORE HBV [FROM <(f)>] [<a:ADDITIVE>] => hb_mvRestore( <(f)>, <.a.> )
#command SAVE HBV TO <(f)> ALL LIKE <p>    => hb_mvSave( <(f)>, <(p)>, .t. )
#command SAVE HBV ALL LIKE <p> TO <(f)>    => hb_mvSave( <(f)>, <(p)>, .t. )
#command SAVE HBV ALL EXCEPT <p> TO <(f)>  => hb_mvSave( <(f)>, <(p)>, .f. )
#command SAVE HBV TO <(f)> ALL EXCEPT <p>  => hb_mvSave( <(f)>, <(p)>, .f. )
#command SAVE HBV [TO <(f)>] [ALL]         => hb_mvSave( <(f)>, "*", .t. )  
you will find hb_mvRestore() and hb_mvSave() in c:\hmg.3.4.4\0\MEMVAR\testmemvar.prg
have fun
Jimmy
User avatar
mol
Posts: 3720
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Contact:

Re: MEM file issue

Post by mol »

I was wonder if HBV is able to store arrays. But, after tests, I think not :(
User avatar
AUGE_OHR
Posts: 2062
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany

Re: MEM file issue

Post by AUGE_OHR »

hi,
mol wrote: Thu Aug 20, 2020 1:52 pm I was wonder if HBV is able to store arrays. But, after tests, I think not :(
have you try HB_Serialize(aArray) before hb_mvSave() :idea:
have fun
Jimmy
RPC
Posts: 285
Joined: Fri Feb 10, 2017 4:12 am
DBs Used: DBF

Re: MEM file issue

Post by RPC »

AUGE_OHR wrote: Wed Aug 19, 2020 11:12 pm you will find hb_mvRestore() and hb_mvSave() in c:\hmg.3.4.4\0\MEMVAR\testmemvar.prg
Hi Jimmy
I could not locate testmemvar.prg in my HMG or Harbour folder.
Can you please upload it
Thanks
Post Reply