Ayuda con Mod_Harbour Mercury class

mod_harbour is an Apache module that allows to run PRGs directly on the web !!!

Ayuda con Mod_Harbour Mercury class

Postby RSalazarU » Thu Mar 11, 2021 1:45 pm

Estimados amigos del foro:

Soy nuevo en Mod_Harbour, estoy empezando a conocerlo, todo estaba bien hasta que me plante al aprehender mercury.

Al ejecutar un ejemplo de controlador con mercury me da error.
error: Syntax error "syntax error at '_HB_MEMBER'"

Abajo los detalles de mi avance

Intale Apache64
- Ok

Instale Mod_Harbour
- Ok

http://localhost/mod_harbour_samples/info.prg

Info
Platform
OS Windows 8 6.2
Harbour Harbour 3.2.0dev (r2004201301)
Build date Jun 23 2020 16:45:39
Compiler Microsoft Visual C 19.26.28806 (64-bit)
Capabilities
RDD DBF, DBFFPT, DBFNSX, SIXCDX, DBFCDX, SDF, DELIM, DBFBLOB, DBFNTX
Version Harbour
00 HB_VERSION_HARBOUR Harbour 3.2.0dev (r2004201301)
01 HB_VERSION_COMPILER Microsoft Visual C 19.26.28806 (64-bit)


Instale TWeb
- Ok



Instale Mercury
- lOk

http://localhost/mercury/

Welcome to Mercury
Version: Mercury v1.08b


- Aprendiendo Mercury:

* Nuestra primera vista: hello.view
localhost/go: OK
localhost/go/view1: OK
localhost/go/view2: OK

* Inyectando código PRG
localhost/go/state: OK

* Controller
Ejemplo de un controlador que envia los datos a una view: ERROR

- Al parecer no logra compilar bien customer.prg, en la que esta definida la clase customer

el error: Syntax error "syntax error at '_HB_MEMBER'"

http://localhost/go/search

Mercury Error
Description Value
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:17
Subsytem COMPILER
Code

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
0016 _HB_CLASS Customer ; function Customer ( ... ) ; 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() ) ) ;
0017 _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 ) )
0018 _HB_MEMBER GetByState( oController); oClass:AddMethod( "GetByState", @Customer_GetByState(), nScope + iif( .F., 8, 0 ) + iif( .F., 256, 0 ) + iif( .F., 2048, 0 ) )
0019 _HB_MEMBER Search( oController); oClass:AddMethod( "Search", @Customer_Search(), nScope + iif( .F., 8, 0 ) + iif( .F., 256, 0 ) + iif( .F., 2048, 0 ) )
0020 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 ;
0021
0022 static FUNCTION Customer_New( oController ) ; local Self AS CLASS Customer := QSelf() AS CLASS Customer
0023 RETURN Self
0024
0025 static FUNCTION Customer_GetByState( oController ) ; local Self AS CLASS Customer := QSelf() AS CLASS Customer
0026 RETURN nil
0027
0028 static FUNCTION Customer_Search( oController ) ; local Self AS CLASS Customer := QSelf() AS CLASS Customer
0029 AP_RPuts( "
","Hello search" )
0030 RETURN nil


De antemano muchas gracias por la ayuda.

Rolando
Cochabamba, Bolivia.
RSalazarU
 
Posts: 211
Joined: Wed Jul 16, 2008 12:59 pm
Location: Cochabamba-Bolivia

Return to mod_harbour

Who is online

Users browsing this forum: No registered users and 7 guests