Migrar xHarbour a Harbour HBClass

Migrar xHarbour a Harbour HBClass

Postby Compuin » Fri Apr 14, 2017 11:01 pm

Hola

MIgrando de xHarbour a Habrbour 3.2 tengo problemas con la HBClass, al parecer Harbour no la reconoce

__oDatabase := HBClass():New( cClsName, __CLS_PARAM ( cFromClass ) )

Ya que me arroja lo siguiente

Error: Unresolved external '_HB_FUN___CLS_PARAM' referenced from...

Alguna solucion ?
FWH 20.12
Hbmk2 32/64 Bits (Build 19.29.30133)
Microsoft Visual C 32 Bits
MySql 8.0.24 32/64 Bits
VS Code
Compuin
 
Posts: 1213
Joined: Tue Dec 28, 2010 1:29 pm
Location: Quebec, Canada

Re: Migrar xHarbour a Harbour HBClass

Postby xmanuel » Fri Apr 14, 2017 11:24 pm

Cambia esto:
Code: Select all  Expand view
__oDatabase := HBClass():New( cClsName, __CLS_PARAM ( cFromClass ) )

por esto:
Code: Select all  Expand view
__oDatabase := HBClass():New( cClsName,{ cFromClass } )
______________________________________________________________________________
Sevilla - Andalucía
xmanuel
 
Posts: 756
Joined: Sun Jun 15, 2008 7:47 pm
Location: Sevilla

Re: Migrar xHarbour a Harbour HBClass

Postby Compuin » Fri Apr 14, 2017 11:40 pm

No funciono

Arroja esto

:SETREADPADALL
FWH 20.12
Hbmk2 32/64 Bits (Build 19.29.30133)
Microsoft Visual C 32 Bits
MySql 8.0.24 32/64 Bits
VS Code
Compuin
 
Posts: 1213
Joined: Tue Dec 28, 2010 1:29 pm
Location: Quebec, Canada

Re: Migrar xHarbour a Harbour HBClass

Postby xmanuel » Fri Apr 14, 2017 11:49 pm

Pero eso no tiene nada que ver con el error anterior...
Tal vez si pusieras más código podríamos ver a qué se debe el error :oops:
______________________________________________________________________________
Sevilla - Andalucía
xmanuel
 
Posts: 756
Joined: Sun Jun 15, 2008 7:47 pm
Location: Sevilla

Re: Migrar xHarbour a Harbour HBClass

Postby Compuin » Fri Apr 14, 2017 11:53 pm

Aca el codigo

function TMyMSQuery( cCls ) ; return( MyGenClass( cCls, TMSQuery() ) )

The variable __aHCls
AAdd( __aHCls, { cClsName, __nClassH } )

the class and handle
How free

static __aHCls := {}

#include "HbClass.ch"

function MyGenClass( cClsName, FromClass )

local n, __nClassH, __odatabase
local cFromClass := upper( FromClass:ClassName() )

cClsName := "TMY" + Upper( if( empty( cClsName ), ;
PadL( len( __aHCls ), 7, "0" ), Alltrim( cClsName ) ) )

if ( n := AScan( __aHCls, { |aClass| aClass[ 1 ] == cClsName } ) ) == 0
_HB_CLASS cClsName
__oDatabase := HBClass():New( cClsName, { cFromClass } )
__oDatabase:Create()
__nClassH := __oDatabase:hClass
AAdd( __aHCls, { cClsName, __nClassH } )
else
__nClassH := __aHCls[ n, 2 ]
endif

return( __clsInst( __nClassH ) )

//Cretae the function for deleted __aHCls the handling
//the class

Function CloseClass( oClase )
Local n,cClsName

cClsName := "TMY" + Upper( PadL( len( __aHCls ), 7, "0" ) )

if ( n := AScan( __aHCls, { |aClass| aClass[ 1 ] == cClsName } ) ) == 0
// ya se creo la clase
else
__aHCls[ n, 1 ]:=NIL
__aHCls[ n, 2 ]:=NIL
ADEL( __aHCls , n )

endif
oClase:=NIL

return( cClsName )
FWH 20.12
Hbmk2 32/64 Bits (Build 19.29.30133)
Microsoft Visual C 32 Bits
MySql 8.0.24 32/64 Bits
VS Code
Compuin
 
Posts: 1213
Joined: Tue Dec 28, 2010 1:29 pm
Location: Quebec, Canada

Re: Migrar xHarbour a Harbour HBClass

Postby xmanuel » Sat Apr 15, 2017 1:26 am

Esto es parte del código de mi librería Eagle1.
Y en esa parte no se hace referencia al método :setReadPadAll()
Code: Select all  Expand view

//---------------------------------------------------------------------------//
// Activa la lectura de todos los campos caracter formateados a su tamaño

METHOD SetReadPADAll( lRead ) CLASS TMSDataSet
return( E1SetPadAll( ::hMySQL, lRead ) )

//---------------------------------------------------------------------------//

 

Y la parte en C
Code: Select all  Expand view

//---------------------------------------------------------------------------//
// Activa o desactiva la lectura de cadenas con tamao fijo (PAD) en todas

E1_FUNC( E1SETPADALL )
{
    PE1_DATASET hDS = (PE1_DATASET) hb_parnl( 1 );
    PHB_ITEM iRead = hb_param( 2, HB_IT_LOGICAL );

    if( iRead )
    {
        BOOL bRead = hb_itemGetL( iRead );

        if( !( bRead == hDS->bReadPadAll ) )
        {
            unsigned int uiCol;

            hDS->bReadPadAll = bRead;

            for( uiCol = 0; uiCol < hDS->uiColCount; uiCol++ )
            {
                if( E1_PCOLUMN( hDS, uiCol )->cType == 'C' )
                {
                    E1_PCOLUMN( hDS, uiCol )->GetValue = ( bRead ? E1_GetPADC : E1_GetC );
                }
            }
            hb_retl( !bRead );
        }
    }
    hb_retl( hDS->bReadPadAll );
}

//---------------------------------------------------------------------------//

 
______________________________________________________________________________
Sevilla - Andalucía
xmanuel
 
Posts: 756
Joined: Sun Jun 15, 2008 7:47 pm
Location: Sevilla

Re: Migrar xHarbour a Harbour HBClass

Postby Compuin » Sat Apr 15, 2017 1:45 am

El codigo que te puse no usa metodos..pero igual sigue sin funcionar
Last edited by Compuin on Sat Apr 15, 2017 2:46 am, edited 1 time in total.
FWH 20.12
Hbmk2 32/64 Bits (Build 19.29.30133)
Microsoft Visual C 32 Bits
MySql 8.0.24 32/64 Bits
VS Code
Compuin
 
Posts: 1213
Joined: Tue Dec 28, 2010 1:29 pm
Location: Quebec, Canada

Re: Migrar xHarbour a Harbour HBClass

Postby Compuin » Sat Apr 15, 2017 1:50 am

No funciona...arroja esto

Error description: Error BASE/1004 Message not found: TMY0000000:SETREADPADALL
Args:
[ 1] = O TMY0000000

Stack Calls
===========
Called from: => __ERRRT_SBASE( 0 )
Called from: ../../../tobject.prg => TMY0000000:ERROR( 0 )
Called from: ../../../tobject.prg => (b)HBOBJECT( 0 )
Called from: ../../../tobject.prg => TMY0000000:MSGNOTFOUND( 0 )
Called from: ../../../tobject.prg => TMY0000000:SETREADPADALL( 0 )
FWH 20.12
Hbmk2 32/64 Bits (Build 19.29.30133)
Microsoft Visual C 32 Bits
MySql 8.0.24 32/64 Bits
VS Code
Compuin
 
Posts: 1213
Joined: Tue Dec 28, 2010 1:29 pm
Location: Quebec, Canada

Re: Migrar xHarbour a Harbour HBClass

Postby xmanuel » Sat Apr 15, 2017 10:03 am

Si no usas métodos o sea objetos o sea clases no necesitas ese código:
La funcion TMyMSQuery es una meta clase que crea clases especializados en una tabla o SELECT de MySQL.
Y :SetReadPADAll() es un método.
______________________________________________________________________________
Sevilla - Andalucía
xmanuel
 
Posts: 756
Joined: Sun Jun 15, 2008 7:47 pm
Location: Sevilla

Re: Migrar xHarbour a Harbour HBClass

Postby Compuin » Sat Apr 15, 2017 12:09 pm

Y a que se debe que lance el error al cambiar __oDatabase := HBClass():New( cClsName, __CLS_PARAM ( cFromClass ) )por __oDatabase := HBClass():New( cClsName,{ cFromClass } ) ?
FWH 20.12
Hbmk2 32/64 Bits (Build 19.29.30133)
Microsoft Visual C 32 Bits
MySql 8.0.24 32/64 Bits
VS Code
Compuin
 
Posts: 1213
Joined: Tue Dec 28, 2010 1:29 pm
Location: Quebec, Canada

Re: Migrar xHarbour a Harbour HBClass

Postby Antonio Linares » Sat Apr 15, 2017 6:37 pm

regards, saludos

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

Re: Migrar xHarbour a Harbour HBClass

Postby Compuin » Sat Apr 15, 2017 6:41 pm

Segun esto no es posible migrar de xHarbour a Harbour ?
FWH 20.12
Hbmk2 32/64 Bits (Build 19.29.30133)
Microsoft Visual C 32 Bits
MySql 8.0.24 32/64 Bits
VS Code
Compuin
 
Posts: 1213
Joined: Tue Dec 28, 2010 1:29 pm
Location: Quebec, Canada

Re: Migrar xHarbour a Harbour HBClass

Postby Antonio Linares » Sat Apr 15, 2017 6:55 pm

Lo que debes plantearte es modificar ese código para que no necesite usar esas funciones
regards, saludos

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

Re: Migrar xHarbour a Harbour HBClass

Postby Carlos Mora » Sat Apr 15, 2017 6:56 pm

No creo que sea una cosa 'imposible'. Otra cosa es que si se usan 'internals' del lenguaje, hay que asumir las consecuencias. Como dice Antonio, una de esas consecuencias es por lo que estás pasando: prestaciones que no son de "usuario", como crear clases a bajo nivel, que no son directamente extrapolables de un lenguaje a otro. Para que eso te salga bien tienes que programar a nivel dios (o ser Manu expósito :).

De todas maneras revisando el hilo el problema es que no reconoce el mensaje 'SETREADPADALL', por lo que te recomiendo verifiques en la superclase como está definido ese método. Manu explicó que hace ese método e incluyó el código, por lo que es por donde yo empezaría a buscar.

Un saludo
Saludos
Carlos Mora
http://harbouradvisor.blogspot.com/
StackOverflow http://stackoverflow.com/users/549761/carlos-mora
“If you think education is expensive, try ignorance"
Carlos Mora
 
Posts: 988
Joined: Thu Nov 24, 2005 3:01 pm
Location: Madrid, España

Re: Migrar xHarbour a Harbour HBClass

Postby xmanuel » Sun Apr 16, 2017 10:26 am

Carlos me sobrevaloras :D
De cualquier modo Eagle1 funciona tanto con Harbour como con xHarbour...
______________________________________________________________________________
Sevilla - Andalucía
xmanuel
 
Posts: 756
Joined: Sun Jun 15, 2008 7:47 pm
Location: Sevilla

Next

Return to FiveWin para Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 17 guests