HMG 3.0.34

HMG announcements; Latest HMG-related news, releases, fixes and updates.

Moderator: Rathinagiri

User avatar
Roberto Lopez
HMG Founder
Posts: 4023
Joined: Wed Jul 30, 2008 6:43 pm

Re: HMG 3.0.34

Post 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?
Regards/Saludos,

Roberto


(Veritas Filia Temporis)
User avatar
mol
Posts: 3805
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Contact:

Re: HMG 3.0.34

Post 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
User avatar
Roberto Lopez
HMG Founder
Posts: 4023
Joined: Wed Jul 30, 2008 6:43 pm

Re: HMG 3.0.34

Post 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.
Regards/Saludos,

Roberto


(Veritas Filia Temporis)
User avatar
mol
Posts: 3805
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Contact:

Re: HMG 3.0.34

Post 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
 
Post Reply