Migrating to Harbour
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Re: Migrating to Harbour
it errors...
If you want Harbour you will have to drop "|"
Life is hard
If you want Harbour you will have to drop "|"
Life is hard
- Enrico Maria Giordano
- Posts: 7355
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
Re: Migrating to Harbour
Antonio,
as I said, that's not the last problem. There are many others. It looks like I have to drop Harbour definitely...
EMG
as I said, that's not the last problem. There are many others. It looks like I have to drop Harbour definitely...
EMG
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Re: Migrating to Harbour
Enrico,
Well, to have a xHarbour expert with us is always a good thing
Well, to have a xHarbour expert with us is always a good thing
- Enrico Maria Giordano
- Posts: 7355
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
Re: Migrating to Harbour
Anyway, I'll slowly try again, as time permits...
EMG
- Enrico Maria Giordano
- Posts: 7355
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
Re: Migrating to Harbour
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
It seems that now I can test my applications with Harbour!
EMG
- Enrico Maria Giordano
- Posts: 7355
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
Re: Migrating to Harbour
Next problem: xHarbour supports the third parameter for MemoWrit() to get rid of EOF character. How to do that with Harbour?
EMG
EMG
- Enrico Maria Giordano
- Posts: 7355
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
Re: Migrating to Harbour
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.
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
xHarbour 1.2.1 (Rev 6406) + BCC
Harbour 3.1 (Rev 17062) + BCC
Harbour 3.2.0dev (r1904111533) + BCC
- Enrico Maria Giordano
- Posts: 7355
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
- Enrico Maria Giordano
- Posts: 7355
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
Re: Migrating to Harbour
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α".
EMG
Code: Select all
#include "Fivewin.ch"
//REQUEST HB_CODEPAGE_ITWIN
FUNCTION MAIN()
// HB_SETCODEPAGE( "ITWIN" )
FCREATE( "testà" )
RETURN NIL
- Enrico Maria Giordano
- Posts: 7355
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
Re: Migrating to Harbour
One more problem. This is a sample:
It errors out with the following error message:
EMG
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
Code: Select all
Error WINOLE/1006 (0x800A03EC): _VALUE (DOS Error -2147352567)
Called from TOLEAUTO:_VALUE(0)
Called from MAIN(11)
Re: Migrating to Harbour
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 CP437Do you know if the code below is the right way to handle non-ascii characters? With the two line commented out I get "testα".
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
xHarbour 1.2.1 (Rev 6406) + BCC
Harbour 3.1 (Rev 17062) + BCC
Harbour 3.2.0dev (r1904111533) + BCC
- Enrico Maria Giordano
- Posts: 7355
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
Re: Migrating to Harbour
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:Sorry Enrico. My programs don't use non-ascii character so I don't have any knowledge nor experience about it.
Thank you. I can't believe that I'm the only one that uses non-ascii characters...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
EMG
- Enrico Maria Giordano
- Posts: 7355
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
Re: Migrating to Harbour
Any suggestions?Enrico Maria Giordano wrote:One more problem. This is a sample:
It errors out with the following error message: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
EMGCode: Select all
Error WINOLE/1006 (0x800A03EC): _VALUE (DOS Error -2147352567) Called from TOLEAUTO:_VALUE(0) Called from MAIN(11)
EMG
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Re: Migrating to Harbour
Enrico,
is the same code working with xHarbour ?
Is Excel already running ?
is the same code working with xHarbour ?
Is Excel already running ?