Page 7 of 28
Re: HMGSCRIPT 2012: Programming For The Web in The Right Way
Posted: Sat Jun 02, 2012 12:29 pm
by Roberto Lopez
rathinagiri wrote:
I have uploaded hmgscript in
hmgscript. So, we can test the behavior immediately.
In the way you've published it, only works with your local server if it is running. It's not really online.
If you are running the server on a home/office windows machine you will need to connect that machine to some service, like no-ip, forward the port 2000 and give it a domain name. Then change this line:
socket = new WebSocket( "ws://localhost:2000/harbour" );
To:
socket = new WebSocket( "ws://something.no-ip.org:2000/harbour" );
Re: HMGSCRIPT 2012: Programming For The Web in The Right Way
Posted: Sat Jun 02, 2012 12:31 pm
by Roberto Lopez
Rossine wrote:Hi Roberto,
Here a more detailed example:
Thanks again!
Re: HMGSCRIPT 2012: Programming For The Web in The Right Way
Posted: Sat Jun 02, 2012 12:53 pm
by Rathinagiri
Roberto Lopez wrote:rathinagiri wrote:
I have uploaded hmgscript in
hmgscript. So, we can test the behavior immediately.
In the way you've published it, only works with your local server if it is running. It's not really online.
If you are running the server on a home/office windows machine you will need to connect that machine to some service, like no-ip, forward the port 2000 and give it a domain name. Then change this line:
socket = new WebSocket( "ws://localhost:2000/harbour" );
To:
socket = new WebSocket( "ws://something.no-ip.org:2000/harbour" );
Yes. I do agree Roberto. All the demo html files are working except server demo because of no wsserver running behind. If it is in a LAN system and the machine name running the server is 'machine1', then
Code: Select all
socket = new WebSocket( "ws://machine1:2000/harbour" );
or
socket = new WebSocket( "ws://10.0.0.1:2000/harbour" );
will be enough. Right?
Re: HMGSCRIPT 2012: Programming For The Web in The Right Way
Posted: Sat Jun 02, 2012 1:10 pm
by Roberto Lopez
rathinagiri wrote:Roberto Lopez wrote:rathinagiri wrote:
Yes. I do agree Roberto. All the demo html files are working except server demo because of no wsserver running behind. If it is in a LAN system and the machine name running the server is 'machine1', then
Code: Select all
socket = new WebSocket( "ws://machine1:2000/harbour" );
or
socket = new WebSocket( "ws://10.0.0.1:2000/harbour" );
will be enough. Right?
If you plan to use the application inside the LAN, it should work.
But, if you plan to use the application over the Internet, you must proceed as explained in the previous post.
Re: HMGSCRIPT 2012: Programming For The Web in The Right Way
Posted: Sat Jun 02, 2012 1:12 pm
by Roberto Lopez
Roberto Lopez wrote:
But, if you plan to use the application over the Internet, you must proceed as explained in the previous post.
In the case that you have a fixed ip, you can omit the no-ip thing and use that address directly.
And, if you have cablemodem Internet (like me in my home now) you'll could not be able to make a server work at all (depending on your provider policies).
Re: HMGSCRIPT 2012: Programming For The Web in The Right Way
Posted: Sat Jun 02, 2012 1:24 pm
by Rathinagiri
I understand well now.

Re: HMGSCRIPT 2012: Programming For The Web in The Right Way
Posted: Sat Jun 02, 2012 8:41 pm
by Roberto Lopez
Hi All,
The R006 with LOTS of improvements in communication with the server.
HMGSCRIPT 2012 FUNCTION REFERENCE (R006)
WINDOW:
Element: DIV
You can use all the properties, events and methods availables for it via DOM.
Syntax:
Window( cId , cCaption , nWidth , nHeight )
BUTTON:
Element: INPUT (Type: BUTTON)
You can use all the properties, events and methods availables for it via DOM.
Syntax:
Button( cId , cParentId , nRow , nCol , cCaption , cOnClick )
LABEL:
Element: SPAN
You can use all the properties, events and methods availables for it via DOM.
Syntax:
Label( cId , cParentId , nRow , nCol , cValue )
TEXTBOX:
Element: INPUT (Type: TEXT)
You can use all the properties, events and methods availables for it via DOM.
Syntax:
TextBox( cId , cParentId , nRow , nCol , cValue )
IMAGE:
Element: IMAGE
You can use all the properties, events and methods availables for it via DOM.
Syntax:
Image( cId , cParentId , nRow , nCol , cSrc )
MSGINFO:
Syntax:
MsgInfo( cMessage , cCaption )
RELEASE:
Releases a window.
Syntax:
Release( cId )
CONNECT:
Creates a websocket connection.
Syntax:
Connect()
SENDMESSAGE:
Send a message to a websocket server via the current open connection.
Syntax:
SendMessage( cText )
GETMESSAGE:
Get a message from a websocket server via the current open connection.
Syntax:
cAnswer = GetMessage()
Enjoy!
Re: HMGSCRIPT 2012: Programming For The Web in The Right Way
Posted: Sat Jun 02, 2012 9:30 pm
by Roberto Lopez
Well...
We got basic GUI functionality, remote access to a .dbf files via the internet and Harbour remote procedures, so, we have HMG (some sort of

) running on web browsers!
So, HMGSCRIPT is a reality!
Most of the pending work is easy, excepting for GRID... but, I'm sure that sooner or later we will do it.
Thanks for your support!
I'll rest a little tomorrow (I really need it!).
Re: HMGSCRIPT 2012: Programming For The Web in The Right Way
Posted: Sat Jun 02, 2012 9:40 pm
by Roberto Lopez
Roberto Lopez wrote:Hi All,
The R006 with LOTS of improvements in communication with the server.
A tip about updated server.
The message that you send via the SendMessage() function is directly macro substituted and its result is asigned to a variable that will be send back to your browser via GetMessage().
Please consider that both ( send and received) messages must be character type.
Re: HMGSCRIPT 2012: Programming For The Web in The Right Way
Posted: Sat Jun 02, 2012 9:44 pm
by Roberto Lopez
Roberto Lopez wrote:Hi All,
The R006 with LOTS of improvements in communication with the server.
A tip about updated server.
The message that you send via the SendMessage() function is directly macro substituted and its result is asigned to a variable that will be send back to your browser via GetMessage().
Please consider that both ( send and received) messages must be character type.
So, you could replace button_1 in server demo with:
Code: Select all
Button( 'button_1' , 'win' , 240 , 110 , "Exec. dtoc(date()) " , "SendMessage( 'dtoc(date())' )" );
And you will get the current date as answer.