Page 2 of 2
Re: HMG 3.0.34
Posted: Mon May 24, 2010 11:30 am
by Roberto Lopez
mol wrote:I think, I found a problem with HMG 3.0.34
Variables are not assumed as memory variables rather as fields.
When I have opened database, my variable is taken from database, though PRIVATE DECLARATION
Are you talking about Grid fields?
Re: HMG 3.0.34
Posted: Mon May 24, 2010 7:02 pm
by mol
Are you talking about Grid fields?
No!
Simply, I have opened database (DBF/CDX no matter what's structure)
Then I call my standard function which was working good from 1 year.
And - it causes error.
First - I've added some msgboxes to find what's going on.
But it didn't help.
So, I've compiled with debugger and found that values from my memory variable declared!!! as private is ignored, and it its place is taken value from my opened database.
I think it's caused by compiler directives - assume alle variables as fields or something like that (I don't know how it's named in harbour, there was something like that in clipper...).
I can prepare tomorrow a little sample if it will help you find this ?bug?.
I think it's a bug because after changing name of memory variable everything works OK.
Regards, Marek
Re: HMG 3.0.34
Posted: Mon May 24, 2010 7:30 pm
by Roberto Lopez
mol wrote:
Are you talking about Grid fields?
No!
Simply, I have opened database (DBF/CDX no matter what's structure)
Then I call my standard function which was working good from 1 year.
And - it causes error.
First - I've added some msgboxes to find what's going on.
But it didn't help.
So, I've compiled with debugger and found that values from my memory variable declared!!! as private is ignored, and it its place is taken value from my opened database.
I think it's caused by compiler directives - assume alle variables as fields or something like that (I don't know how it's named in harbour, there was something like that in clipper...).
I can prepare tomorrow a little sample if it will help you find this ?bug?.
I think it's a bug because after changing name of memory variable everything works OK.
Regards, Marek
It should be not related with HMG library in any way, but, I'll check your sample.
Re: HMG 3.0.34
Posted: Tue May 25, 2010 5:58 am
by mol
I've prepeared a little sample.
It shows that variables are assumed as fields not as memory variables at compilation time.
Maybe it's not a bug, but I'm used that variables are memory assumed...
How to change compilator options to do it?
Code: Select all
#include <hmg.ch>
function Main
local aFields := { { "Operator","C",3,0 }, { "Op_name","C",20,0 } }
private Operator, cString1, cString2, cString3, cString4
if !file("ops")
DBCreate( "ops", aFields )
endif
use ops new
index on Operator to ops1
zap
append blank
replace;
ops->Operator with "001",;
ops->Op_Name with "Test"
// operator is declared as private above
Operator := "+"
cString1 := "111"
cString2 := "999"
cString3 := cString1 + Operator + cString2
cString4 := cString1 + m->Operator + cString2
msgBox( "The value of 'operator' is: -->" + Operator + "<---" + chr(10)+ ;
"The value of 'm->operator' is: -->" + m->Operator + "<---" + chr(10)+ ;
"cString3 value is: -->" + cString3 + "<---" + chr(10) + ;
"cString4 value is: -->" + cString4 + "<---")
return