Migrating to Harbour

User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: Migrating to Harbour

Post by Antonio Linares »

it errors...

If you want Harbour you will have to drop "|" :-(

Life is hard :-D
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Enrico Maria Giordano
Posts: 7355
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Contact:

Re: Migrating to Harbour

Post by Enrico Maria Giordano »

Antonio,

as I said, that's not the last problem. There are many others. It looks like I have to drop Harbour definitely... :-(

EMG
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: Migrating to Harbour

Post by Antonio Linares »

Enrico,

Well, to have a xHarbour expert with us is always a good thing :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Enrico Maria Giordano
Posts: 7355
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Contact:

Re: Migrating to Harbour

Post by Enrico Maria Giordano »

Good news! I found a workaround (I replaced "|" with "+", it's not the same but worked fine in my case). Then I could fix the next problem too (I forgot the default value for an instance variable declared LOGICAL - xHarbour doesn't care).

It seems that now I can test my applications with Harbour! :-)

EMG
User avatar
Enrico Maria Giordano
Posts: 7355
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Contact:

Re: Migrating to Harbour

Post by Enrico Maria Giordano »

Next problem: xHarbour supports the third parameter for MemoWrit() to get rid of EOF character. How to do that with Harbour?

EMG
hua
Posts: 861
Joined: Fri Oct 28, 2005 2:27 am

Re: Migrating to Harbour

Post by hua »

Enrico,
Normally if I want to try to convert to harbour I do this steps:

i. Add #include "xhb.ch" and linking in xhb.lib. To avoid having to add the header file to each prgs, I put it in fivewin.ch.

ii. Any regular expression statement is enclosed in brackets. For example cVar has ".*@.*\.com" will become (cVar has ".*@.*\.com"). That sentence would be compiled correctly under both xharbour and Harbour.

After grepping header files in harbour\contrib\xhb I found that logical operators have also been taken into account.
So 1|2 if written as (1|2) would be correctly preprocessed to hb_bitor(1,2) but your sample code uses macro so I'm not sure how to solve that.

Memowrit() is correctly pre-processed to use hb_memowrit() if the 3rd parameter is passed.

Hope that helps.
Last edited by hua on Mon Dec 22, 2014 2:02 am, edited 1 time in total.
FWH 11.08/FWH 19.03
xHarbour 1.2.1 (Rev 6406) + BCC
Harbour 3.1 (Rev 17062) + BCC
Harbour 3.2.0dev (r1904111533) + BCC
User avatar
Enrico Maria Giordano
Posts: 7355
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Contact:

Re: Migrating to Harbour

Post by Enrico Maria Giordano »

Do you know if the code below is the right way to handle non-ascii characters? With the two line commented out I get "testα".

Code: Select all

#include "Fivewin.ch"

//REQUEST HB_CODEPAGE_ITWIN


FUNCTION MAIN()

//    HB_SETCODEPAGE( "ITWIN" )

    FCREATE( "testà" )

    RETURN NIL
EMG
User avatar
Enrico Maria Giordano
Posts: 7355
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Contact:

Re: Migrating to Harbour

Post by Enrico Maria Giordano »

One more problem. This is a sample:

Code: Select all

FUNCTION MAIN()

    LOCAL oExcel := CREATEOBJECT( "Excel.Application" )

    LOCAL oSheet

    oExcel:WorkBooks:Add()

    oSheet = oExcel:ActiveSheet

    oSheet:Cells( 1, 1 ):Value = CTOD( "" )

    oExcel:Visible = .T.

    RETURN NIL
It errors out with the following error message:

Code: Select all

Error WINOLE/1006   (0x800A03EC): _VALUE (DOS Error -2147352567)
Called from TOLEAUTO:_VALUE(0)
Called from MAIN(11)
EMG
hua
Posts: 861
Joined: Fri Oct 28, 2005 2:27 am

Re: Migrating to Harbour

Post by hua »

Do you know if the code below is the right way to handle non-ascii characters? With the two line commented out I get "testα".
Sorry Enrico. My programs don't use non-ascii character so I don't have any knowledge nor experience about it. I only know the default codepage used by Harbour is CP437

The only observation I can offer you is that even enabling the rem'ed out lines I don't get testà. On my PC I had to change the code to as shown below to make it work.

Code: Select all

#include "Fivewin.ch"
REQUEST HB_CODEPAGE_IT437

FUNCTION MAIN()
    HB_SETCODEPAGE( "IT437" )

    FCREATE( "testà" )

    RETURN NIL
FWH 11.08/FWH 19.03
xHarbour 1.2.1 (Rev 6406) + BCC
Harbour 3.1 (Rev 17062) + BCC
Harbour 3.2.0dev (r1904111533) + BCC
User avatar
Enrico Maria Giordano
Posts: 7355
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Contact:

Re: Migrating to Harbour

Post by Enrico Maria Giordano »

hua wrote:Sorry Enrico. My programs don't use non-ascii character so I don't have any knowledge nor experience about it.
I can't believe that. What if the user create a document with non-ascii characters and you have to copy or move or open or print it?
hua wrote:I only know the default codepage used by Harbour is CP437

The only observation I can offer you is that even enabling the rem'ed out lines I don't get testà. On my PC I had to change the code to as shown below to make it work.

Code: Select all

#include "Fivewin.ch"
REQUEST HB_CODEPAGE_IT437

FUNCTION MAIN()
    HB_SETCODEPAGE( "IT437" )

    FCREATE( "testà" )

    RETURN NIL
Thank you. I can't believe that I'm the only one that uses non-ascii characters...

EMG
User avatar
Enrico Maria Giordano
Posts: 7355
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Contact:

Re: Migrating to Harbour

Post by Enrico Maria Giordano »

Enrico Maria Giordano wrote:One more problem. This is a sample:

Code: Select all

FUNCTION MAIN()

    LOCAL oExcel := CREATEOBJECT( "Excel.Application" )

    LOCAL oSheet

    oExcel:WorkBooks:Add()

    oSheet = oExcel:ActiveSheet

    oSheet:Cells( 1, 1 ):Value = CTOD( "" )

    oExcel:Visible = .T.

    RETURN NIL
It errors out with the following error message:

Code: Select all

Error WINOLE/1006   (0x800A03EC): _VALUE (DOS Error -2147352567)
Called from TOLEAUTO:_VALUE(0)
Called from MAIN(11)
EMG
Any suggestions? :-)

EMG
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: Migrating to Harbour

Post by Antonio Linares »

Enrico,

is the same code working with xHarbour ?

Is Excel already running ?
regards, saludos

Antonio Linares
www.fivetechsoft.com
Post Reply