Page 17 of 28

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

Posted: Fri Jun 15, 2012 4:17 am
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!

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

Posted: Fri Jun 15, 2012 4:40 am
by Rathinagiri
Thanks Roberto. :)

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

Posted: Sat Jun 16, 2012 5:03 am
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!

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

Posted: Sat Jun 16, 2012 9:02 pm
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...

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

Posted: Sat Jun 16, 2012 9:07 pm
by Roberto Lopez

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

Posted: Sun Jun 17, 2012 4:07 am
by bpd2000
Dear Roberto

Thank you for providing link

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

Posted: Sun Jun 17, 2012 4:12 am
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.

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

Posted: Sun Jun 17, 2012 1:24 pm
by Rathinagiri
Very nice Roberto.

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

Posted: Sun Jun 17, 2012 10:49 pm
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).

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

Posted: Mon Jun 18, 2012 10:58 am
by luisfrancisco62
genial, gracias desde colombia, como seria con una ventana de login? y una funcion para menu?

gracias muchas gracias