HMGSCRIPT 2012: Programming For The Web in The Right Way :)
Moderator: Rathinagiri
- Rathinagiri
- Posts: 5480
- Joined: Tue Jul 29, 2008 6:30 pm
- DBs Used: MariaDB, SQLite, SQLCipher and MySQL
- Location: Sivakasi, India
- Contact:
Re: HMGSCRIPT 2012: Programming For The Web in The Right Way
Great Roberto!
I have to study a lot this weekend to cope up with the improvements.
I have to study a lot this weekend to cope up with the improvements.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
South or North HMG is worth.
...the possibilities are endless.
Re: HMGSCRIPT 2012: Programming For The Web in The Right Way
Hi Roberto,
Wow
Thank you for being expanding our horizons
I work for many years with HRB. What do you need ?
Below an example of how to put generate it and run it.
Thank you very much for all 
Rossine.
Wow


Thank you for being expanding our horizons

I work for many years with HRB. What do you need ?
Below an example of how to put generate it and run it.
Code: Select all
#include "minigui.ch"
PROCEDURE Main
DEFINE WINDOW Win_Main ;
AT 0,0 ;
WIDTH 600 ;
HEIGHT 400 ;
TITLE 'Test program' ;
MAIN
DEFINE STATUSBAR ;
FONT 'Times New Roman' SIZE 12
STATUSITEM ''
END STATUSBAR
@10,10 BUTTON Btn_1 ;
CAPTION 'Run Script' ;
WIDTH 200 ;
HEIGHT 25 ;
ONCLICK RunScript()
END WINDOW
Win_Main.StatusBar.Item(1) := 'HMG Power Ready'
CENTER WINDOW Win_Main
ACTIVATE WINDOW Win_Main
RETURN
PROCEDURE RunScript
local CONTENT, HANDLE_HRB, PRG, HRBCODE
PRG := ;
"proc p()" + hb_eol() + ;
" SetProperty ( 'Win_Main', 'StatusBar' , 'Item' , 1 , 'Hello World' ) "+ hb_eol() + ;
" MsgInfo( 'Hello World' )" + hb_eol() + ;
"return"
HRBCODE := hb_compileFromBuf( PRG, "harbour", "-n", "-w3", "-es2", "-q0" )
memowrit( "myhrb.hrb", sx_encrypt( HRBCODE, "myPaswdKey" ) )
CONTENT := sx_decrypt( memoread( "myhrb.hrb" ), "myPaswdKey" )
HANDLE_HRB := hb_hrbload( CONTENT )
hb_hrbDo( HANDLE_HRB )
hb_hrbunload( HANDLE_HRB )
RETURN

Rossine.
- Rathinagiri
- Posts: 5480
- Joined: Tue Jul 29, 2008 6:30 pm
- DBs Used: MariaDB, SQLite, SQLCipher and MySQL
- Location: Sivakasi, India
- Contact:
Re: HMGSCRIPT 2012: Programming For The Web in The Right Way
That is so cool Rossine. 

East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
South or North HMG is worth.
...the possibilities are endless.
- Rathinagiri
- Posts: 5480
- Joined: Tue Jul 29, 2008 6:30 pm
- DBs Used: MariaDB, SQLite, SQLCipher and MySQL
- Location: Sivakasi, India
- Contact:
Re: HMGSCRIPT 2012: Programming For The Web in The Right Way
Roberto,
demo.server.html is working fine (only) in Chrome.
wssocket.exe should be run as an administrator and firewall should be opened up.
demo.server.html is working fine (only) in Chrome.
wssocket.exe should be run as an administrator and firewall should be opened up.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
South or North HMG is worth.
...the possibilities are endless.
- Rathinagiri
- Posts: 5480
- Joined: Tue Jul 29, 2008 6:30 pm
- DBs Used: MariaDB, SQLite, SQLCipher and MySQL
- Location: Sivakasi, India
- Contact:
Re: HMGSCRIPT 2012: Programming For The Web in The Right Way
Now, my basic doubts:
1. Can wssocket server be started in a Linux machine.
2. Can we make it run in a leased web space provider's system? (for example, can I someway start wssocket server in our forum's server providers system?)
I have uploaded hmgscript in www.hmgforum.com/hmgscript. So, we can test the behavior immediately.
1. Can wssocket server be started in a Linux machine.
2. Can we make it run in a leased web space provider's system? (for example, can I someway start wssocket server in our forum's server providers system?)
I have uploaded hmgscript in www.hmgforum.com/hmgscript. So, we can test the behavior immediately.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
South or North HMG is worth.
...the possibilities are endless.
- Roberto Lopez
- HMG Founder
- Posts: 4012
- Joined: Wed Jul 30, 2008 6:43 pm
Re: HMGSCRIPT 2012: Programming For The Web in The Right Way
Is working fine for me with FireFox 12.0.rathinagiri wrote:Roberto,
demo.server.html is working fine (only) in Chrome.
wssocket.exe should be run as an administrator and firewall should be opened up.
Which version are you using?
Regards/Saludos,
Roberto
(Veritas Filia Temporis)
Roberto
(Veritas Filia Temporis)
- Rathinagiri
- Posts: 5480
- Joined: Tue Jul 29, 2008 6:30 pm
- DBs Used: MariaDB, SQLite, SQLCipher and MySQL
- Location: Sivakasi, India
- Contact:
Re: HMGSCRIPT 2012: Programming For The Web in The Right Way
Sorry I am using FireFox 10. I will update now and check.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
South or North HMG is worth.
...the possibilities are endless.
- Roberto Lopez
- HMG Founder
- Posts: 4012
- Joined: Wed Jul 30, 2008 6:43 pm
Re: HMGSCRIPT 2012: Programming For The Web in The Right Way
R1: I guess yes, but I'm not tested. I've tweaked the command line, but you can look at the application and you'll find option to make it run as a daemon instead as a normal app.rathinagiri wrote:Now, my basic doubts:
1. Can wssocket server be started in a Linux machine.
2. Can we make it run in a leased web space provider's system? (for example, can I someway start wssocket server in our forum's server providers system?)
I have uploaded hmgscript in hmgscript. So, we can test the behavior immediately.
R2: I don't know, but my first thinking is that is not possible, but I'm not sure. The alternative, as I've stated in a previous post is to use a PHP based websockets server. There is code available. Just google it.
Regards/Saludos,
Roberto
(Veritas Filia Temporis)
Roberto
(Veritas Filia Temporis)
- Roberto Lopez
- HMG Founder
- Posts: 4012
- Joined: Wed Jul 30, 2008 6:43 pm
Re: HMGSCRIPT 2012: Programming For The Web in The Right Way
Thanks!Rossine wrote:Hi Roberto,
Wow![]()
![]()
Thank you for being expanding our horizons![]()
I work for many years with HRB. What do you need ?
Below an example of how to put generate it and run it.
My idea is to pass message to the server with the name of external .hrb modules to execute, so there will be no need to recompile the whole server when you want to add or modify a module.
I'll start testing.
Regards/Saludos,
Roberto
(Veritas Filia Temporis)
Roberto
(Veritas Filia Temporis)
Re: HMGSCRIPT 2012: Programming For The Web in The Right Way
Hi Roberto,
Here a more detailed example:
Best Regards,
Rossine.
Here a more detailed example:
Code: Select all
#include "hbcompat.ch"
function MAIN
local CONTEUDO, nHandle
cls
CREATES_NEWHRB()
CONTEUDO := HRB_LoadFromFileEncrypted( "myhrb.hrb", "mypassword" )
try
nHandle := hb_hrbload( CONTEUDO )
catch oErr
? "Error load in hrb"
quit
end
if empty( nHandle )
? "Error call hrb"
quit
endif
? call_func( nHandle, "p1", "1" )
? call_func( nHandle, "p2", "2" )
hb_hrbunload( nHandle )
return NIL
*************************
static function call_func( nHandle, cFunc, xPar )
*************************
local xRet := HB_HRBGETFUNSYM( nHandle, cFunc )
if empty( xRet )
? "Error load in function " + cFunc
quit
endif
return eval( xRet, xPar )
********************************
function HRB_SaveToFileEncrypted( cEncFileName, cKey, cHrbBody )
********************************
local cFile
if !empty( cHrbBody )
cHrbBody := hb_zcompress( cHrbBody )
cHrbBody := sx_encrypt( cHrbBody, cKey )
hb_memowrit( cEncFileName, cHrbBody )
endif
return NIL
**********************************
function HRB_LoadFromFileEncrypted( cFile, cKey )
**********************************
local cHrbBody
cHrbBody := hb_memoread( cFile )
cHrbBody := sx_decrypt( cHrbBody, cKey )
cHrbBody := hb_zuncompress( cHrbBody )
return cHrbBody
***********************
function CREATES_NEWHRB
***********************
local CONTENT, HANDLE_HRB, PRG, HRBCODE
PRG := ;
"function p1( cPar )" + hb_eol() + ;
"? 'Hello World One ' + cPar" + hb_eol() + ;
"return 'One'" + hb_eol() + ;
"function p2( cPar )" + hb_eol() + ;
"? 'Hello World Two ' + cPar" + hb_eol() + ;
"return 'Two'"
HRBCODE := hb_compileFromBuf( PRG, "harbour", "-n", "-w3", "-es2", "-q0" )
HRB_SaveToFileEncrypted( "myhrb.hrb", "mypassword", HRBCODE )
RETURN
Rossine.