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 »

HMGSCRIPT R015

Hi,

I've added a new server function (Modify()) and made several changes to existing ones. The most important: I've added error handling to avoid that a wrong parameter crash the server. The error description is sent to the client as response to the SendMessage() function.

Code: Select all

MODIFY: (Server Function)
-------------------------

Modifies a record.

Syntax:

	Modify( cTable , aColumns , aValues , cForExpr )

Enjoy!
Attachments
hmgs015.zip
(838.87 KiB) Downloaded 405 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 »

Thanks 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 »

HMGSCRIPT R016

Hi all,

I've added security to the server and made other minimal modifications.

Code: Select all

LOGIN: (Server Function)
------------------------

Starts a server session.

Syntax:

	Login ( cUser , cPassword )



LOGOUT: (Server Function)
-------------------------

Ends a server session.

Syntax:

	Logout ()

Enjoy!
Attachments
hmgs016.zip
(839.88 KiB) Downloaded 384 times
Regards/Saludos,

Roberto


(Veritas Filia Temporis)
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 R017

Well... we are getting serious now...

After many tests and a light headache, I've concluded that the only way to make things easier is to complicate them a little :)

Definitively we must to use objects to simplify development and the use of the library.

It will be very easy since functions in JavaScript are objects already.

I've replaced the panel/query combination with a true browse object with its refresh method to retrieve and show data from the server.

It is extremely easy to use now, since I've successfully hidden the callback.

Code: Select all

BROWSE:
-------

Creates an HTML table inside a scrollable DIV, loaded with the specified dbf query.

Syntax:

	Browse( cId, cParentId, nRow, nCol, nWidth, nHeight, cDbfFile, aColumns, 
	aHeaders , cForExpr , cOrder  )

Methods:

	refresh()

Notes:

	- 'cId' is the id of the HTML table created (to be accessed via DOM).
	- 'cParentId' is the Id of the parent window.
	

Example:

	oBrowse = new Browse( 'browse1' , 
			'win', 050 , 050 , 550 , 300 , '[test]' , 
			'{ [code] , [first] , [last] , [birth] , [married] }' , 
			'{ [Code] , [First] , [last] , [Birth] , [Married] }' , 
			'[code < 100]' , '[code]' );

	oBrowse.refresh()
Please take a look at the updated server demo.

All other widgets will follow the same path...
Attachments
hmgs017.zip
(840.82 KiB) Downloaded 358 times
Regards/Saludos,

Roberto


(Veritas Filia Temporis)
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 »

Regards/Saludos,

Roberto


(Veritas Filia Temporis)
User avatar
bpd2000
Posts: 1207
Joined: Sat Sep 10, 2011 4:07 am
Location: India

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

Post by bpd2000 »

Dear Roberto

Thank you for providing link
BPD
Convert Dream into Reality through HMG
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 R018

Now, browse parameters are all true JavaScript types.

Example:

Code: Select all

	oBrowse = new Browse( 
		'browse1' , 
		'win' , 
		050 , 050 , 550 , 300 , 
		'test' , [ 'code' , 'first' , 'last' , 'birth' , 'married' ] , 
		[ 'Code' , 'First' , 'last' , 'Birth' , 'Married' ] , 
		'code < 100' , 
		'code' );

	oBrowse.refresh()

Code: Select all

Syntax:

	Browse( cId, cParentId, nRow, nCol, nWidth, nHeight, cDbfFile, aColumns, 
	aHeaders , cForExpr , cOrder  )

Methods:

	refresh()

Notes:

	'cId' is the id of the HTML table created (to be accessed via DOM).
	'cParentId' is the Id of the parent window.
Attachments
hmgs018.zip
(841 KiB) Downloaded 370 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 »

Very nice 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 »

The next steps...

I'll stop development again to learn more about JavaScript, to be sure that the basic library design will be the right one (as simple and easy to use as possible).
Regards/Saludos,

Roberto


(Veritas Filia Temporis)
User avatar
luisfrancisco62
Posts: 66
Joined: Thu Mar 18, 2010 12:16 am
Location: Colombia
Contact:

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

Post by luisfrancisco62 »

genial, gracias desde colombia, como seria con una ventana de login? y una funcion para menu?

gracias muchas gracias
Post Reply