FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour xHarbour -> Harbour compatibility
Posts: 811
Joined: Tue May 06, 2008 04:28 AM
xHarbour -> Harbour compatibility
Posted: Wed Jan 14, 2009 09:14 AM

Hi!

I wish to test my xHarbour+FWH8.12 to Harbour 1.0.1

problem is... I have GLOBAL and GLOBAL EXTERNAL declarations... massive like entirely on my .prgs'

question is... What can I do?

Regards,

Kind Regards,

Frances



Fivewin for xHarbour v18.07

xHarbour v1.2.3.x

BCC 7.3 + PellesC8 ( Resource Compiler only)

ADS 10.1 / MariaDB

Crystal Reports 8.5/9.23 DE

xMate v1.15
Posts: 248
Joined: Wed Jan 11, 2006 11:30 AM
Re: xHarbour -> Harbour compatibility
Posted: Wed Jan 14, 2009 10:58 AM

I converts a system with my Xharbour to Harbour without any problem, but I used this harbour:

http://sourceforge.net/project/download ... p65460143

because he thought more complete, the xHb.lib used to avoid conflicts in some statements to my xharbour.

It worked smoothly

Saluds, Ale

&

aleseribeli@hotmail.com

FwH, Hb Svn, ADS 8.1, ADS 10, Pelles C, FwPPC, MsVc 2008, MsVc 2010
"Conhecimento, você não subtrai quando divide; mas soma e multiplica."
**---Mário Persona---**
Posts: 811
Joined: Tue May 06, 2008 04:28 AM
Re: xHarbour -> Harbour compatibility
Posted: Thu Jan 15, 2009 02:00 AM
Hello Ale,

I tried to include xHB.lib but I still having errors on my GLOBAL..EXTERNAL variables

Using xMate compiling xHarbour App to Harbour 1.0.1:



Regards
Kind Regards,

Frances



Fivewin for xHarbour v18.07

xHarbour v1.2.3.x

BCC 7.3 + PellesC8 ( Resource Compiler only)

ADS 10.1 / MariaDB

Crystal Reports 8.5/9.23 DE

xMate v1.15
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Re: xHarbour -> Harbour compatibility
Posted: Thu Jan 15, 2009 02:19 AM

Frances,

Try this define:

define GLOBAL public

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 811
Joined: Tue May 06, 2008 04:28 AM
Re: xHarbour -> Harbour compatibility
Posted: Thu Jan 15, 2009 03:30 AM
Antonio Linares wrote:Frances,

Try this define:

#define GLOBAL public



Mr. Antonio,

Thank you for the suggestion and reply.

Public has to be inside procedure/function... I will just move my variable declarations into my init procedure...

But what about the GLOBAL EXTERNAL? would it be #define GLOBAL EXTERNAL public ?


Regards
Kind Regards,

Frances



Fivewin for xHarbour v18.07

xHarbour v1.2.3.x

BCC 7.3 + PellesC8 ( Resource Compiler only)

ADS 10.1 / MariaDB

Crystal Reports 8.5/9.23 DE

xMate v1.15
Posts: 782
Joined: Wed Dec 19, 2007 07:50 AM
Re: xHarbour -> Harbour compatibility
Posted: Thu Jan 15, 2009 07:19 AM
fraxzi wrote:But what about the GLOBAL EXTERNAL? would it be #define GLOBAL EXTERNAL public ?
Hi Mr. Frances:

I think you'll get the same efect with: #xtransalate GLOBAL EXTERNAL => Public

Regards.

Manuel Mercado.
manuelmercado at prodigy dot net dot mx
Posts: 782
Joined: Wed Dec 19, 2007 07:50 AM
Re: xHarbour -> Harbour compatibility
Posted: Thu Jan 15, 2009 07:25 AM
mmercado wrote:I think you'll get the same efect with: #xtransalate GLOBAL EXTERNAL => Public
Sorry for the typo, I meant:
#xtranslate GLOBAL EXTERNAL => Public
manuelmercado at prodigy dot net dot mx
Posts: 811
Joined: Tue May 06, 2008 04:28 AM
Re: xHarbour -> Harbour compatibility
Posted: Thu Jan 15, 2009 07:38 AM

Thank you so much Gurus Manuel and Antonio,

But after compilation.... I have tons of to do...

I need to abandon and going back to xHarbour where all apps are written... :wink:

sorry.

Kind regards,

Kind Regards,

Frances



Fivewin for xHarbour v18.07

xHarbour v1.2.3.x

BCC 7.3 + PellesC8 ( Resource Compiler only)

ADS 10.1 / MariaDB

Crystal Reports 8.5/9.23 DE

xMate v1.15
Posts: 1335
Joined: Fri Jun 13, 2008 11:04 AM
Re: xHarbour -> Harbour compatibility
Posted: Thu Jan 15, 2009 07:44 AM

Dear Mr.Fraxzi,

Can I ask you the reason for moving from xHarbour to Harbour.

Any advantage ? Or is it just for testing purpose

Regards

Anser

Posts: 811
Joined: Tue May 06, 2008 04:28 AM
Re: xHarbour -> Harbour compatibility
Posted: Thu Jan 15, 2009 08:09 AM
anserkk wrote:Dear Mr.Fraxzi,

Can I ask you the reason for moving from xHarbour to Harbour.

Any advantage ? Or is it just for testing purpose

Regards

Anser



Mr. Anser,

Nice to hear from you again.

I dont mind answering.... well, I havent tried Harbour ever since I jumped to xHarbour...
I noticed that Harbour project is more active than xHarbour (based on release dates) so I just wonder what could be the experience and difference (?).

I guess I wouldn't know the advantage... But i'm still optimistic in converting/testing my apps with Harbour 1.0.1 or latest.


Regards,
Kind Regards,

Frances



Fivewin for xHarbour v18.07

xHarbour v1.2.3.x

BCC 7.3 + PellesC8 ( Resource Compiler only)

ADS 10.1 / MariaDB

Crystal Reports 8.5/9.23 DE

xMate v1.15
Posts: 1335
Joined: Fri Jun 13, 2008 11:04 AM
Re: xHarbour -> Harbour compatibility
Posted: Thu Jan 15, 2009 08:15 AM

Dear Mr.Fraxzi,

Thankyou for the explanation :D

Regards

Anser

Posts: 824
Joined: Thu Oct 13, 2005 07:39 AM
Re: xHarbour -> Harbour compatibility
Posted: Thu Jan 15, 2009 08:57 AM
Manuel,

mmercado wrote:
mmercado wrote:I think you'll get the same efect with: #xtranslate GLOBAL EXTERNAL => Public


I think, GLOBAL EXTERNAL must be replaced by MEMVAR, because you define a (GLOBAL) PUBLIC variable in the main module and then in all other modules using this variable, you have to decleare this variable as GLOBAL EXTERNAL or MEMVAR.

#xtranslate GLOBAL EXTERNAL => MEMVAR
kind regards

Stefan
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Re: xHarbour -> Harbour compatibility
Posted: Thu Jan 15, 2009 09:36 AM

Frances, Stefan,

yes, I agree too that you could use Stefan suggestion, to translate global external into memvar.

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 464
Joined: Tue May 16, 2006 07:47 AM
Re: xHarbour -> Harbour compatibility
Posted: Fri Jan 16, 2009 11:11 AM
Whilst it isn't a direct replacement in the sense that it isn't a matter of simply using an #xcommand or #xtranslate you can achieve the required outcome using a class to hold all your globals as member variables. I find this technique very useful.

You could use something along the following lines:
CLASS GlobalData

DATA ADSServer
DATA ADSLogin
...

METHOD New() CONSTRUCTOR

ENDCLASS

METHOD New() CLASS GlobalData

::ADSServer := 0
::ADSLogin := 0
...

RETURN self
Posts: 167
Joined: Thu Mar 22, 2007 11:24 AM
Re: xHarbour -> Harbour compatibility
Posted: Fri Jan 16, 2009 11:17 AM

Hello,

In old days , in clipper , global variables were simulated as :

In prog1

GLOBAL var1 change in STATIC Var1

ifdef __XHARBOUR

GLOBAL Var1

else

STATIC Var1

endif

In prg1 we provide a function

ifndef __XHARBOUR

FUNCTION Var1()
RETURN var1

Or
FUNCTION Var1(NewValue)
IF PCOUNT()>0
Var1 := NewValue
END
RETURN var1

endif

In other modules

ifdef __XHARBOUR

GLOBAL EXTERNAL Var1

else

# xtranslate var1=>var1()

endif

Frank