xHarbour -> Harbour compatibility

xHarbour -> Harbour compatibility

Postby fraxzi » Wed Jan 14, 2009 9: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
User avatar
fraxzi
 
Posts: 811
Joined: Tue May 06, 2008 4:28 am
Location: Philippines

Re: xHarbour -> Harbour compatibility

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

Re: xHarbour -> Harbour compatibility

Postby fraxzi » Thu Jan 15, 2009 2: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:

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

Re: xHarbour -> Harbour compatibility

Postby Antonio Linares » Thu Jan 15, 2009 2:19 am

Frances,

Try this define:

#define GLOBAL public
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42118
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: xHarbour -> Harbour compatibility

Postby fraxzi » Thu Jan 15, 2009 3: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
User avatar
fraxzi
 
Posts: 811
Joined: Tue May 06, 2008 4:28 am
Location: Philippines

Re: xHarbour -> Harbour compatibility

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

Re: xHarbour -> Harbour compatibility

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

Re: xHarbour -> Harbour compatibility

Postby fraxzi » Thu Jan 15, 2009 7: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
User avatar
fraxzi
 
Posts: 811
Joined: Tue May 06, 2008 4:28 am
Location: Philippines

Re: xHarbour -> Harbour compatibility

Postby anserkk » Thu Jan 15, 2009 7: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
User avatar
anserkk
 
Posts: 1333
Joined: Fri Jun 13, 2008 11:04 am
Location: Kochi, India

Re: xHarbour -> Harbour compatibility

Postby fraxzi » Thu Jan 15, 2009 8: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
User avatar
fraxzi
 
Posts: 811
Joined: Tue May 06, 2008 4:28 am
Location: Philippines

Re: xHarbour -> Harbour compatibility

Postby anserkk » Thu Jan 15, 2009 8:15 am

Dear Mr.Fraxzi,

Thankyou for the explanation :D

Regards

Anser
User avatar
anserkk
 
Posts: 1333
Joined: Fri Jun 13, 2008 11:04 am
Location: Kochi, India

Re: xHarbour -> Harbour compatibility

Postby StefanHaupt » Thu Jan 15, 2009 8: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.

Code: Select all  Expand view  RUN
#xtranslate GLOBAL EXTERNAL => MEMVAR
kind regards
Stefan
StefanHaupt
 
Posts: 824
Joined: Thu Oct 13, 2005 7:39 am
Location: Germany

Re: xHarbour -> Harbour compatibility

Postby Antonio Linares » Thu Jan 15, 2009 9: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
User avatar
Antonio Linares
Site Admin
 
Posts: 42118
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: xHarbour -> Harbour compatibility

Postby xProgrammer » 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:
Code: Select all  Expand view  RUN
CLASS GlobalData

DATA ADSServer
DATA ADSLogin
...

METHOD New() CONSTRUCTOR

ENDCLASS

METHOD New() CLASS GlobalData

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

RETURN self
User avatar
xProgrammer
 
Posts: 464
Joined: Tue May 16, 2006 7:47 am
Location: Australia

Re: xHarbour -> Harbour compatibility

Postby demont frank » 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
demont frank
 
Posts: 167
Joined: Thu Mar 22, 2007 11:24 am

Next

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot], MaxP, Natter and 71 guests