Thanks; very good newsRoberto Lopez wrote: ...
In the case that I find enough time to create the translator to 'sugarize' the client syntax, you should give it a try.
...
Everybody likes sugar
With my best regards
Moderator: Rathinagiri
Thanks; very good newsRoberto Lopez wrote: ...
In the case that I find enough time to create the translator to 'sugarize' the client syntax, you should give it a try.
...
Is working here... what is exactly the error message?serge_girard wrote:Roberto,
I could not resist a quick try... Compiling (build test.prg) gives an error.. can't find....
Compiling build test (without .prg) is OK.
Serge
Code: Select all
Harbour 3.2.0dev (r1312192324)
Copyright (c) 1999-2013, http://harbour-project.org/
Compiling 'TEST.PRG'...
Lines 9, Functions/Procedures 1
Generating C source output to 'C:\Users\GEBRUI~1\AppData\Local\Temp\hbmk_n7spfs.
dir\TEST.c'... Done.
Het systeem kan het opgegeven bestand niet vinden. (The system can't find the file.. or something)
Druk op een toets om door te gaan. . .(Press any key to continue)
HolaOne file for client side and one file for server side.
The client is HTML and the server is Harbour.
In the case that I find enough time to create the translator to 'sugarize' the client syntax, you should give it a try.
I'm sure that using your own app in a phone is an enough reward
Code: Select all
/* build.bat :
**************
@ECHO OFF
CLS
SET HBPATH=C:\harbour\bin
SET HMGINCPATH=c:\hmgweb\include
SET APACHECGIPATH=c:\hmgweb\apache\cgi-bin
%HBPATH%\hbmk2 %1 -i%HMGINCPATH% hbmysql.hbc hbmisc.hbc hbnetio.hbc hbct.hbc -shared
IF ERRORLEVEL 0 MOVE %1.exe %APACHECGIPATH%\%1.cgi
*/
// TEST.PRG --> TEST.CGI ------------------------------------------------------
#include "hmg.ch"
#include "error.ch"
#include "common.ch"
#require "hbnetio"
REQUEST HB_GT_CGI_DEFAULT
REQUEST HB_GT_WIN_DEFAULT
FUNCTION MAIN()
/**************/
LOCAL aQuery := {}
PUBLIC cNetServer := '127.0.0.1' // local server or any addres (even Internet)
PUBLIC nNetPort := 2941 // you can choose any you want
PUBLIC cNetPass := 'something_secret' // Idem
PUBLIC _HMG_SYSDATA_ [ 32 ]
cQUERY := getvalue("url")
cWHERE := getvalue("where")
// requested query existing eg: Q_USERS
IF !Connect_NetServer()
xSUR_NAME := ''
xFAM_NAME := ''
ELSE
aQuery := netio_funcexec( cQUERY, cWHERE )
xSUR_NAME := ALLTRIM(aQuery[1] [1] )
xFAM_NAME := ALLTRIM(aQuery[1] [2] )
netio_disconnect( cNetServer , nNetPort )
ENDIF
OutStd( "Content-type: text/html" + hb_OSNewLine() + hb_OSNewLine() )
OutStd( '<br> ' )
OutStd( xSUR_NAME + ' ' + xFAM_NAME + '<br> ' )
/* ok
aAr := Q_USERS()
xSUR_NAME := ALLTRIM(aAr [1] [1] )
xFAM_NAME := ALLTRIM(aAr [1] [2] )
OutStd( "Content-type: text/html" + hb_OSNewLine() + hb_OSNewLine() )
OutStd( '<br> ' )
OutStd( xSUR_NAME + ' ' + xFAM_NAME + '<br> ' ) */
RETURN NIL
FUNCTION Connect_NetServer()
/**************************/
LOCAL c_STR_Con := "net:"
lConnect := netio_connect( cNetServer , nNetPort ,, cNetPass, 9 )
IF .Not. lConnect
RETURN .F.
ENDIF
RETURN .T.
// TEST.PRG --> TEST.CGI ------------------------------------------------------
Code: Select all
FUNCTION Connect_NetServer()
/**************************/
LOCAL c_STR_Con := "net:"
lConnect := netio_connect( cNetServer , nNetPort ,, cNetPass, 9 )
IF .Not. lConnect
RETURN .F.
ENDIF
RETURN .T.
// TEST.PRG --> TEST.CGI ------------------------------------------------------
FUNCTION USERSDBF()
/*******************/
cWHERE := ''
IF !Connect_NetServer()
xSUR_NAME := ''
xFAM_NAME := ''
ELSE
aQuery := netio_funcexec( 'Q_USERS', cWHERE )
xSUR_NAME := ALLTRIM(aQuery[1] [1] )
xFAM_NAME := ALLTRIM(aQuery[1] [2] )
netio_disconnect( cNetServer , nNetPort )
ENDIF
MSGINFO(xSUR_NAME, 'xSUR_NAME')
RETURN
Code: Select all
/*************************************************************************/
/* Q_USERS is located within HMGSERVERIO.PRG */
/* When calling netio_funcexec( 'Q_USERS', '' ) from a HMG Application */
/* (function USERSDBF) this works fine. */
/* */
/* When calling from TEST.CGI it gives a runtime-error: */
/* TEST.cgi - Entrypoint not found */
/* Unable to find entrypoint of procedure hb_fileRegister in DLL-file */
/* harbour-32.dll. */
/* (see att. ) */
/*************************************************************************/
FUNCTION Q_USERS()
/**************************************/
LOCAL a, aRecordset := {}, aFIELD := {}
PARAMETERS cWHERE
USE USERFILE
IF!EMPTY(cWHERE)
SET FILTER TO FAM_NAME == cWHERE
ENDIF
GO TOP
DO WHILE .NOT. EOF()
aFIELD := {}
FOR a = 1 to fcount()
AADD(aFIELD , fieldGet(a) )
NEXT a
AADD( aRecordset , aFIELD )
SKIP
ENDDO
USE
RETURN aRecordset
Sorry... my mistake... its build test (without '.prg')serge_girard wrote:Roberto,
I could not resist a quick try... Compiling (build test.prg) gives an error.. can't find....
Compiling build test (without .prg) is OK.
Serge
I can't help, since I've not tested NETIO on a CGI app.serge_girard wrote:Roberto,
I did some tests with HMG/WEB Alpha 012 + NETIO.
HMG + NETIO works fine but combining with HMG/WEB Alpha 012 gives an runtime-error:
TEST.cgi - Entrypoint not found
Unable to find entrypoint of procedure hb_fileRegister in DLL-file harbour-32.dll
<...>