Migrating to Harbour

Re: Migrating to Harbour

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

Re: Migrating to Harbour

Postby Enrico Maria Giordano » 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
User avatar
Enrico Maria Giordano
 
Posts: 8419
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Migrating to Harbour

Postby Antonio Linares » Sun Dec 21, 2014 9:32 am

Enrico,

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

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

Re: Migrating to Harbour

Postby Enrico Maria Giordano » Sun Dec 21, 2014 10:17 am

:D

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

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

Re: Migrating to Harbour

Postby Enrico Maria Giordano » Sun Dec 21, 2014 3: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
User avatar
Enrico Maria Giordano
 
Posts: 8419
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Migrating to Harbour

Postby Enrico Maria Giordano » Sun Dec 21, 2014 3:58 pm

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

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

Re: Migrating to Harbour

Postby Enrico Maria Giordano » Sun Dec 21, 2014 4:01 pm

Found! Hb_MemoWrit(). :-)

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

Re: Migrating to Harbour

Postby hua » Sun Dec 21, 2014 5: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.
Last edited by hua on Mon Dec 22, 2014 2:02 am, edited 1 time in total.
FWH 11.08/FWH 19.12
BCC5.82/BCC7.3
xHarbour/Harbour
hua
 
Posts: 1061
Joined: Fri Oct 28, 2005 2:27 am


Re: Migrating to Harbour

Postby Enrico Maria Giordano » Sun Dec 21, 2014 6: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: Select all  Expand view
#include "Fivewin.ch"

//REQUEST HB_CODEPAGE_ITWIN


FUNCTION MAIN()

//    HB_SETCODEPAGE( "ITWIN" )

    FCREATE( "testà" )

    RETURN NIL


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

Re: Migrating to Harbour

Postby Enrico Maria Giordano » Sun Dec 21, 2014 7:01 pm

One more problem. This is a sample:

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


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

Re: Migrating to Harbour

Postby hua » Mon Dec 22, 2014 4: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: Select all  Expand view
#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
hua
 
Posts: 1061
Joined: Fri Oct 28, 2005 2:27 am

Re: Migrating to Harbour

Postby Enrico Maria Giordano » Mon Dec 22, 2014 9: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: Select all  Expand view
#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: 8419
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Migrating to Harbour

Postby Enrico Maria Giordano » Mon Dec 22, 2014 3:44 pm

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

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


EMG


Any suggestions? :-)

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

Re: Migrating to Harbour

Postby Antonio Linares » Mon Dec 22, 2014 4:39 pm

Enrico,

is the same code working with xHarbour ?

Is Excel already running ?
regards, saludos

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

PreviousNext

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 34 guests