xHarbour -> Harbour compatibility

User avatar
fraxzi
Posts: 811
Joined: Tue May 06, 2008 4:28 am
Location: Philippines
Contact:

xHarbour -> Harbour compatibility

Post by fraxzi »

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
User avatar
Ale SB
Posts: 248
Joined: Wed Jan 11, 2006 11:30 am
Location: Campo Grande-MS / Brasil

Re: xHarbour -> Harbour compatibility

Post by Ale SB »

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

http://sourceforge.net/project/download ... p&65460143

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---**
User avatar
fraxzi
Posts: 811
Joined: Tue May 06, 2008 4:28 am
Location: Philippines
Contact:

Re: xHarbour -> Harbour compatibility

Post by fraxzi »

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:

Image

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
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: xHarbour -> Harbour compatibility

Post by Antonio Linares »

Frances,

Try this define:

#define GLOBAL public
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
fraxzi
Posts: 811
Joined: Tue May 06, 2008 4:28 am
Location: Philippines
Contact:

Re: xHarbour -> Harbour compatibility

Post by fraxzi »

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
User avatar
mmercado
Posts: 782
Joined: Wed Dec 19, 2007 7:50 am
Location: Salamanca, Gto., México

Re: xHarbour -> Harbour compatibility

Post by mmercado »

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
User avatar
mmercado
Posts: 782
Joined: Wed Dec 19, 2007 7:50 am
Location: Salamanca, Gto., México

Re: xHarbour -> Harbour compatibility

Post by mmercado »

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
User avatar
fraxzi
Posts: 811
Joined: Tue May 06, 2008 4:28 am
Location: Philippines
Contact:

Re: xHarbour -> Harbour compatibility

Post by fraxzi »

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
User avatar
anserkk
Posts: 1280
Joined: Fri Jun 13, 2008 11:04 am
Location: Kochi, India

Re: xHarbour -> Harbour compatibility

Post by anserkk »

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
User avatar
fraxzi
Posts: 811
Joined: Tue May 06, 2008 4:28 am
Location: Philippines
Contact:

Re: xHarbour -> Harbour compatibility

Post by fraxzi »

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
User avatar
anserkk
Posts: 1280
Joined: Fri Jun 13, 2008 11:04 am
Location: Kochi, India

Re: xHarbour -> Harbour compatibility

Post by anserkk »

Dear Mr.Fraxzi,

Thankyou for the explanation :D

Regards

Anser
StefanHaupt
Posts: 824
Joined: Thu Oct 13, 2005 7:39 am
Location: Germany

Re: xHarbour -> Harbour compatibility

Post by StefanHaupt »

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.

Code: Select all

#xtranslate GLOBAL EXTERNAL => MEMVAR
kind regards
Stefan
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: xHarbour -> Harbour compatibility

Post by Antonio Linares »

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
User avatar
xProgrammer
Posts: 464
Joined: Tue May 16, 2006 7:47 am
Location: Australia

Re: xHarbour -> Harbour compatibility

Post by xProgrammer »

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:

Code: Select all

CLASS GlobalData

DATA ADSServer
DATA ADSLogin
...

METHOD New() CONSTRUCTOR

ENDCLASS

METHOD New() CLASS GlobalData

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

RETURN self
demont frank
Posts: 167
Joined: Thu Mar 22, 2007 11:24 am

Re: xHarbour -> Harbour compatibility

Post by demont frank »

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