FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Migrating to Harbour
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM

Re: Migrating to Harbour

Posted: Sat Dec 20, 2014 10:22 PM

it errors...

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

Life is hard :-D

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 9022
Joined: Thu Oct 06, 2005 08:17 PM

Re: Migrating to Harbour

Posted: Sat Dec 20, 2014 11:24 PM

Antonio,

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

EMG

Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM

Re: Migrating to Harbour

Posted: Sun Dec 21, 2014 09:32 AM

Enrico,

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

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 9022
Joined: Thu Oct 06, 2005 08:17 PM

Re: Migrating to Harbour

Posted: Sun Dec 21, 2014 10:17 AM

Anyway, I'll slowly try again, as time permits...

EMG

:D

Posts: 9022
Joined: Thu Oct 06, 2005 08:17 PM

Re: Migrating to Harbour

Posted: Sun Dec 21, 2014 03:55 PM

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

Posts: 9022
Joined: Thu Oct 06, 2005 08:17 PM

Re: Migrating to Harbour

Posted: Sun Dec 21, 2014 03:58 PM

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

EMG

Posts: 9022
Joined: Thu Oct 06, 2005 08:17 PM

Re: Migrating to Harbour

Posted: Sun Dec 21, 2014 04:01 PM

Found! Hb_MemoWrit(). :-)

EMG

Posts: 1096
Joined: Fri Oct 28, 2005 02:27 AM

Re: Migrating to Harbour

Posted: Sun Dec 21, 2014 05:21 PM
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.
FWH 11.08/FWH 19.12

BCC5.82/BCC7.3

xHarbour/Harbour
Posts: 9022
Joined: Thu Oct 06, 2005 08:17 PM
Posts: 9022
Joined: Thu Oct 06, 2005 08:17 PM

Re: Migrating to Harbour

Posted: Sun Dec 21, 2014 06:47 PM
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 (fw): Select all Collapse
#include "Fivewin.ch"

//REQUEST HB_CODEPAGE_ITWIN


FUNCTION MAIN()

//    HB_SETCODEPAGE( "ITWIN" )

    FCREATE( "testà" )

    RETURN NIL


EMG
Posts: 9022
Joined: Thu Oct 06, 2005 08:17 PM

Re: Migrating to Harbour

Posted: Sun Dec 21, 2014 07:01 PM
One more problem. This is a sample:

Code (fw): Select all Collapse
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 (fw): Select all Collapse
Error WINOLE/1006   (0x800A03EC): _VALUE (DOS Error -2147352567)
Called from TOLEAUTO:_VALUE(0)
Called from MAIN(11)


EMG
Posts: 1096
Joined: Fri Oct 28, 2005 02:27 AM

Re: Migrating to Harbour

Posted: Mon Dec 22, 2014 04:17 AM
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 (fw): Select all Collapse
#include "Fivewin.ch"
REQUEST HB_CODEPAGE_IT437

FUNCTION MAIN()
    HB_SETCODEPAGE( "IT437" )

    FCREATE( "testà" )

    RETURN NIL
FWH 11.08/FWH 19.12

BCC5.82/BCC7.3

xHarbour/Harbour
Posts: 9022
Joined: Thu Oct 06, 2005 08:17 PM

Re: Migrating to Harbour

Posted: Mon Dec 22, 2014 09:46 AM
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 (fw): Select all Collapse
#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
Posts: 9022
Joined: Thu Oct 06, 2005 08:17 PM

Re: Migrating to Harbour

Posted: Mon Dec 22, 2014 03:44 PM
Enrico Maria Giordano wrote:One more problem. This is a sample:

Code (fw): Select all Collapse
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 (fw): Select all Collapse
Error WINOLE/1006   (0x800A03EC): _VALUE (DOS Error -2147352567)
Called from TOLEAUTO:_VALUE(0)
Called from MAIN(11)


EMG


Any suggestions? :-)

EMG
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM

Re: Migrating to Harbour

Posted: Mon Dec 22, 2014 04:39 PM

Enrico,

is the same code working with xHarbour ?

Is Excel already running ?

regards, saludos

Antonio Linares
www.fivetechsoft.com