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

Moderator: Rathinagiri

User avatar
Roberto Lopez
HMG Founder
Posts: 4023
Joined: Wed Jul 30, 2008 6:43 pm

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

Post 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!
Regards/Saludos,

Roberto


(Veritas Filia Temporis)
fprijatelj
Posts: 14
Joined: Wed Mar 10, 2010 4:09 pm

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

Post 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
Attachments
WWW.7z
(1.76 MiB) Downloaded 302 times
User avatar
Roberto Lopez
HMG Founder
Posts: 4023
Joined: Wed Jul 30, 2008 6:43 pm

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

Post 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!
Attachments
hmgs013.zip
(571.12 KiB) Downloaded 307 times
Regards/Saludos,

Roberto


(Veritas Filia Temporis)
User avatar
Rathinagiri
Posts: 5481
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

Post by Rathinagiri »

That's it!

So, our base framework is ready. Thanks a lot Roberto.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
User avatar
Roberto Lopez
HMG Founder
Posts: 4023
Joined: Wed Jul 30, 2008 6:43 pm

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

Post 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.
Regards/Saludos,

Roberto


(Veritas Filia Temporis)
User avatar
Rathinagiri
Posts: 5481
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

Post by Rathinagiri »

Very nice and intuitive project goal Roberto. Bravo.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
User avatar
Rathinagiri
Posts: 5481
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

Post 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 4492 times
ws2.jpg
ws2.jpg (6.71 KiB) Viewed 4492 times
ws3.jpg
ws3.jpg (29.89 KiB) Viewed 4492 times
srcgui.zip
(951.22 KiB) Downloaded 266 times
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
User avatar
Roberto Lopez
HMG Founder
Posts: 4023
Joined: Wed Jul 30, 2008 6:43 pm

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

Post 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.
Regards/Saludos,

Roberto


(Veritas Filia Temporis)
User avatar
Rathinagiri
Posts: 5481
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

Post by Rathinagiri »

Ok. Else what should be the value given to xAnswer?
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
User avatar
Roberto Lopez
HMG Founder
Posts: 4023
Joined: Wed Jul 30, 2008 6:43 pm

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

Post by Roberto Lopez »

rathinagiri wrote:Ok. Else what should be the value given to xAnswer?
I guess something like "Message Not Allowed".
Regards/Saludos,

Roberto


(Veritas Filia Temporis)
Post Reply