Migrating to Harbour

User avatar
Antonio Linares
Site Admin
Posts: 42456
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Has thanked: 20 times
Been thanked: 58 times
Contact:

Re: Migrating to Harbour

Post by Antonio Linares »

Are you using FWH CopyFile() ?

Why can't you use Harbour ? What else is missing ? :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Enrico Maria Giordano
Posts: 8738
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Has thanked: 1 time
Been thanked: 2 times
Contact:

Re: Migrating to Harbour

Post by Enrico Maria Giordano »

Antonio Linares wrote:Enrico,

https://github.com/harbour/core/tree/master

Now you have Harbour full source code :-)


Thank you, downloaded! :-)

EMG
User avatar
Enrico Maria Giordano
Posts: 8738
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Has thanked: 1 time
Been thanked: 2 times
Contact:

Re: Migrating to Harbour

Post by Enrico Maria Giordano »

Antonio,

Antonio Linares wrote: __clsAddMsg( hClass, "NewData" , 1, HB_OO_MSG_ACCESS )
__clsAddMsg( hClass, "_NewData" , 1, HB_OO_MSG_ASSIGN )


Are you sure about that "1"? From tclass.prg:

Code: Select all | Expand

        __clsAddMsg( hClass, "hClass"         ,  1, HB_OO_MSG_ACCESS )
         __clsAddMsg( hClass, "_hClass"        ,  1, HB_OO_MSG_ASSIGN )


and

Code: Select all | Expand

        __clsAddMsg( hClass, "aDatas"         ,  3, HB_OO_MSG_ACCESS )
         __clsAddMsg( hClass, "_aDatas"        ,  3, HB_OO_MSG_ASSIGN )
 


and

Code: Select all | Expand

        __clsAddMsg( hClass, "AddData"        , @AddData()        , HB_OO_MSG_METHOD )


I'm confused... :-(

EMG
User avatar
Enrico Maria Giordano
Posts: 8738
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Has thanked: 1 time
Been thanked: 2 times
Contact:

Re: Migrating to Harbour

Post by Enrico Maria Giordano »

Antonio,

Antonio Linares wrote:Enrico,

hClass is the handle of a Class, you can access it this way:

TAnyClass():hClass

or directly from an existing object:

oObject:hClass


Ok, I'll try this too, thank you.

EMG
User avatar
Enrico Maria Giordano
Posts: 8738
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Has thanked: 1 time
Been thanked: 2 times
Contact:

Re: Migrating to Harbour

Post by Enrico Maria Giordano »

Antonio Linares wrote:Are you using FWH CopyFile() ?


Yes. I just compiled and run the sample I reported.

Antonio Linares wrote:Why can't you use Harbour ? What else is missing ? :-)


I don't know. First step is getting a working EXE.

EMG
User avatar
Enrico Maria Giordano
Posts: 8738
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Has thanked: 1 time
Been thanked: 2 times
Contact:

Re: Migrating to Harbour

Post by Enrico Maria Giordano »

Code: Select all | Expand

? TControl():hClass


Code: Select all | Expand

Error BASE/1004  Message not found: TCONTROL:HCLASS


:-(

EMG
User avatar
Enrico Maria Giordano
Posts: 8738
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Has thanked: 1 time
Been thanked: 2 times
Contact:

Re: Migrating to Harbour

Post by Enrico Maria Giordano »

Enrico Maria Giordano wrote:One more problem: a console pops up when I run my EXEs. How to get rid of it?


Solved with:

Code: Select all | Expand

REQUEST HB_GT_GUI_DEFAULT


EMG
User avatar
Enrico Maria Giordano
Posts: 8738
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Has thanked: 1 time
Been thanked: 2 times
Contact:

Re: Migrating to Harbour

Post by Enrico Maria Giordano »

Another problem. The following call doesn't work as expected:

Code: Select all | Expand

MEMOLINE( cRes, 1024, 1, , .F., .T., @nPos )


It keeps reading the first line. :-(

EMG
User avatar
Antonio Linares
Site Admin
Posts: 42456
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Has thanked: 20 times
Been thanked: 58 times
Contact:

Re: Migrating to Harbour

Post by Antonio Linares »

Enrico,

Sorry, it is ClassH instead of hClass :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Enrico Maria Giordano
Posts: 8738
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Has thanked: 1 time
Been thanked: 2 times
Contact:

Re: Migrating to Harbour

Post by Enrico Maria Giordano »

Antonio,

I found contrib/xhb/xhbcls.ch that should offer EXTEND CLASS command. But to check it I first need to solve the MEMOLINE() problem...

EMG
User avatar
Enrico Maria Giordano
Posts: 8738
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Has thanked: 1 time
Been thanked: 2 times
Contact:

Re: Migrating to Harbour

Post by Enrico Maria Giordano »

Summary:

- FileCopy failed to copy filename with à or similar characters

- Memoline don't work properly

- EXTEND CLASS command to check

I really can't believe that someone could have migrated to Harbour with these problems... :?:

EMG
User avatar
Antonio Linares
Site Admin
Posts: 42456
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Has thanked: 20 times
Been thanked: 58 times
Contact:

Re: Migrating to Harbour

Post by Antonio Linares »

Enrico,

How to test the memoline() problem that you have found ?
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Enrico Maria Giordano
Posts: 8738
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Has thanked: 1 time
Been thanked: 2 times
Contact:

Re: Migrating to Harbour

Post by Enrico Maria Giordano »

Antonio,

here it is:

Code: Select all | Expand

FUNCTION MAIN()

    LOCAL cTxt := "This is a test" + CHR( 13 ) + CHR( 10 ) + "This is another test"

    LOCAL nLines

    LOCAL nPos := 1

    LOCAL i

    nLines = MLCOUNT( cTxt, 1024, , .F., .T. )

    ? "Lines: " + LTRIM( STR( nLines ) )
    ?

    FOR i = 1 TO nLines
        ? ALLTRIM( MEMOLINE( cTxt, 1024, 1, , .F., .T., @nPos ) )
    NEXT

    INKEY( 0 )

    RETURN NIL


EMG
User avatar
Antonio Linares
Site Admin
Posts: 42456
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Has thanked: 20 times
Been thanked: 58 times
Contact:

Re: Migrating to Harbour

Post by Antonio Linares »

Enrico,

There is a little bug in your code. This is the right code :-)

? ALLTRIM( MEMOLINE( cTxt, 1024, i, , .F., .T., @nPos ) )
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Enrico Maria Giordano
Posts: 8738
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Has thanked: 1 time
Been thanked: 2 times
Contact:

Re: Migrating to Harbour

Post by Enrico Maria Giordano »

Antonio,

No! The syntax is correct. The third parameter must be 1 because it indicates the line to read starting at nPos. If I replace 1 with i I get only the first line in xHarbour. It looks like Harbour doesn't support parameter nPos... :-(

Unfortunately I'm still unable to use Harbour to compile my applications... :-(

EMG
Post Reply