by EBM » Fri Oct 08, 2021 6:36 pm
Hola Carles,
Mercury ya está funcionando y estoy siguiendo el manual que tienes en compass v1.4. He podido avanzar hasta el punto donde creamos un controller customer.prg
Defino el ROUTE search, creo customer.prg con la clase y sus metodos y el search.view pero al ejecutarlo me manda el siguiente error que no sé como solucionarlo:
File Source customer.prg
Code _HB_MEMBER New( oController) AS CLASS Customer; oClass:AddMethod( "New", @Customer_New(), nScope + iif( .T., 8, 0 ) + iif( .F., 256, 0 ) + iif( .F., 2048, 0 ) )
Description Syntax error "syntax error at '_HB_MEMBER'"
Operation line: 16
Subsytem COMPILER
0001 #line 3
0002 STATIC __lAutenticate
0003 FUNCTION __RunController( o )
0004 LOCAL oC
0005 __lAutenticate := .T.
0006 oC := customer():New( o )
0007 IF __objHasMethod( oC, "search" )
0008 IF __lAutenticate
0009 oC:search(o)
0010 ENDIF
0011 ELSE
0012 App():ShowError( "Method search() not defined in customer.prg controller.", "Controller Error!" )
0013 ENDIF
0014 RETU NIL
0015 _HB_CLASS Customer ; function Customer ( ... ) ; thread STATIC s_oClass ; LOCAL nScope, oClass, oInstance ; IF s_oClass == NIL .AND. __clsLockDef( @s_oClass ) ; BEGIN SEQUENCE ; nScope := 1 ; ( ( nScope ) ) ; oClass := iif( .F.,, HBClass():new( "Customer", iif( .F., { }, { @HBObject() } ), @Customer() ) ) ;
0016 _HB_MEMBER New( oController) AS CLASS Customer; oClass:AddMethod( "New", @Customer_New(), nScope + iif( .T., 8, 0 ) + iif( .F., 256, 0 ) + iif( .F., 2048, 0 ) )
0017 _HB_MEMBER GetByState( oController); oClass:AddMethod( "GetByState", @Customer_GetByState(), nScope + iif( .F., 8, 0 ) + iif( .F., 256, 0 ) + iif( .F., 2048, 0 ) )
0018 _HB_MEMBER Search( oController); oClass:AddMethod( "Search", @Customer_Search(), nScope + iif( .F., 8, 0 ) + iif( .F., 256, 0 ) + iif( .F., 2048, 0 ) )
0019 oClass:Create() ; ; ALWAYS ; __clsUnlockDef( @s_oClass, oClass ) ; end ; oInstance := oClass:Instance() ; IF __objHasMsg( oInstance, "InitClass" ) ; oInstance:InitClass( ... ) ; END ; RETURN oInstance ; END ; RETURN s_oClass:Instance() AS CLASS Customer ;
0020
0021
0022 static FUNCTION Customer_New( oController ) ; local Self AS CLASS Customer := QSelf() AS CLASS Customer
0023 Return Self
0024
0025
0026 static FUNCTION Customer_GetByState( oController ) ; local Self AS CLASS Customer := QSelf() AS CLASS Customer
0027 Return NIL
0028
0029
0030 static FUNCTION Customer_Search( oController ) ; local Self AS CLASS Customer := QSelf() AS CLASS Customer
0031 oController:View( "search.view" )
0032 Return NIL
Ya revisé el codigo y creo que todo esta bien
Que me estará fallando?
Saludos!
Eduardo Borondón Muñiz