Page 1 of 1

XBrowse() Some little known features

PostPosted: Thu Aug 27, 2009 4:57 am
by nageswaragunupudi
Less known feature is the XBROWSER command, which is a command for the XBrowse(). This simple XBrowse() function is a lot more powerful than it appears to be at a first glance. This can even be used as a quick handy object inspector.
Here is a one line program:
Code: Select all  Expand view
#include "FiveWin.Ch"
#include "xbrowse.ch"

function Main()

   XBROWSER '\fwh\samples\customer.dbf' SETUP oBrw:bRClicked := { | r,c,f,oBrw | XBrowse( oBrw ) }

return ( 0 )
 

This one line code opens the dbf file, sets up the browse and closes the file after done. By default, it provides report and excel export functionality. Other clauses of XBROWSER command together with the SETUP clause give us almost total control on the browse.
Whats more interesting is the capability of Xbrowse() function to browse DATA of any object.

Here is the screen shot: As expected, we see a browse of customer table.

Image

Now let us right click anywhere on the browse. We now see a simple object inspector like browse of oBrw object. Here is the screen shot.

Image

Now go to the value column of aCols DATA and double cloick. We see an array of TXBRWCOLUMN objects

Image

Now again double click on any row. We see object inspector of the Column Object

Image

Try going to the value of cHeader and edit the value modifying as 'NAME'. Then close all the sub-browses. You will find the new heading in the main browse.

Not that this capability can be used to release any features in the production application. But this function can be used as a good tool during development.

Re: XBrowse() Some little known features

PostPosted: Thu Aug 27, 2009 5:44 am
by anserkk
Dear Mr.Rao,

Very informative demonstration about the powers of xBrowse. Great !!!

Regards
Anser

Re: XBrowse() Some little known features

PostPosted: Thu Aug 27, 2009 6:33 am
by Otto
Hello Mr. Rao,

>Try going to the value of cHeader and edit the value modifying as 'NAME'. Then close all the sub-browses. You will find the new heading in the main browse.

Is it possible to save these values?

Best regards,
Otto

Re: XBrowse() Some little known features

PostPosted: Thu Aug 27, 2009 6:54 am
by nageswaragunupudi
Is it possible to save these values?

You can export to excel and then you do what you like.

I find this feature handy to debug during development stage. We can view the values of data at any time during runtime.