Page 15 of 28

Re: HMGSCRIPT 2012: Programming For The Web in The Right Way

Posted: Mon Jun 11, 2012 2:17 am
by Roberto Lopez
Rossine wrote:Hi Roberto,
<...>
Below I leave a class I made for handling temporary files.
<...>
I hope that will help you :D

Best Regards,

Rossine.
Thanks!

Re: HMGSCRIPT 2012: Programming For The Web in The Right Way

Posted: Mon Jun 11, 2012 11:14 am
by fprijatelj
Hi

Here is a very simple harbour + www sample:
On github

https://github.com/fprijate/wwwharbour/ ... er/sample1

And in attachement :
1. start _SERVER.BAT
2. start In browser : http://localhost:8002
3 You can change port in httpd.ini
4 you can replace BLAGO.DBF AND BLAGO.CDX with your dbf and cdx file (just rename them
to BLAGO.DBF and BLAGO.CDX)
5. You can change default CodePage changing defCodePage="SLWIN" to your cp in httpd.ini

Just for beginning.
I have much, much ... more.

Regards
FranĨek

Re: HMGSCRIPT 2012: Programming For The Web in The Right Way

Posted: Tue Jun 12, 2012 7:49 pm
by Roberto Lopez
HMGSCRIPT R013

I've modified the server to allow it to receive large messages (code borrowed from current Daniel Garcia Gil WebSockets Server).

This way, we have enough space to send any message to the server, being possible now to fully customize our server functions.

I've enhanced a little the server Query() function:
QUERY: (Server Function)

Executes a query on the server and returns a row-selectable table with the results.

Syntax:

Query( cId, cDbf, aColumns, aHeaders, cFilter, cOrder )
I've updated the server demo with the new Query function features.

Enjoy!

Re: HMGSCRIPT 2012: Programming For The Web in The Right Way

Posted: Tue Jun 12, 2012 8:17 pm
by Rathinagiri
That's it!

So, our base framework is ready. Thanks a lot Roberto.

Re: HMGSCRIPT 2012: Programming For The Web in The Right Way

Posted: Wed Jun 13, 2012 1:16 am
by Roberto Lopez
rathinagiri wrote:That's it!

So, our base framework is ready. Thanks a lot Roberto.
Yes, it is!

I've started with the more difficult part, but it proves that the project is viable.

You can retrieve a dbf table from the server, and select records for further processing.

All we need now, is to create the pending generic server functions (append, delete, modify) and the pending most used GUI widgets (checkbox, listbox, combo and radio).

Then, a fully functional application will be possible.

Remember that all the properties, events and methods of the controls are already available via DOM, so, we don't need to code it.

The following stage could be create wrapper functions/methods to simplify access to GUI objects and new, more advanced widgets.

Finally, a PHP websockets server with the same generic functions as Harbour one, to be able to use the same application, when a non-in-house harbour server be possible.

This PHP server, could allow us to access dbf files with the native PHP capabilities to handle them, and, of course, MySql.

Re: HMGSCRIPT 2012: Programming For The Web in The Right Way

Posted: Wed Jun 13, 2012 3:49 am
by Rathinagiri
Very nice and intuitive project goal Roberto. Bravo.

Re: HMGSCRIPT 2012: Programming For The Web in The Right Way

Posted: Wed Jun 13, 2012 8:07 am
by Rathinagiri
Hi Roberto,

I could compile and run the websocket server with GUI after enabling -mt in HMG build.bat and manually calling from the project folder. :)

I have attached the whole project folder along with the executable. Everything is working fine but when I press the disconnect button the following error is fired. ( I think this one is not captured in console mode?)
ws1.jpg
ws1.jpg (8.41 KiB) Viewed 4494 times
ws2.jpg
ws2.jpg (6.71 KiB) Viewed 4494 times
ws3.jpg
ws3.jpg (29.89 KiB) Viewed 4494 times
srcgui.zip
(951.22 KiB) Downloaded 266 times

Re: HMGSCRIPT 2012: Programming For The Web in The Right Way

Posted: Wed Jun 13, 2012 1:36 pm
by Roberto Lopez
rathinagiri wrote:Hi Roberto,

I could compile and run the websocket server with GUI after enabling -mt in HMG build.bat and manually calling from the project folder. :)

I have attached the whole project folder along with the executable. Everything is working fine but when I press the disconnect button the following error is fired. ( I think this one is not captured in console mode?)
Is possible...

We must filter the received messages to macro-substitute only the predefined server functions.

At first, a simple IF will be enough. You must ask if the message received start with 'query('. This should solve the problem.

Re: HMGSCRIPT 2012: Programming For The Web in The Right Way

Posted: Wed Jun 13, 2012 2:22 pm
by Rathinagiri
Ok. Else what should be the value given to xAnswer?

Re: HMGSCRIPT 2012: Programming For The Web in The Right Way

Posted: Wed Jun 13, 2012 2:28 pm
by Roberto Lopez
rathinagiri wrote:Ok. Else what should be the value given to xAnswer?
I guess something like "Message Not Allowed".