FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour XBrowse() Some little known features
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
XBrowse() Some little known features
Posted: Thu Aug 27, 2009 04:57 AM
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 (fw): Select all Collapse
#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.



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.



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



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



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.
Regards



G. N. Rao.

Hyderabad, India
Posts: 1335
Joined: Fri Jun 13, 2008 11:04 AM
Re: XBrowse() Some little known features
Posted: Thu Aug 27, 2009 05:44 AM

Dear Mr.Rao,

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

Regards
Anser

Posts: 6983
Joined: Fri Oct 07, 2005 07:07 PM
Re: XBrowse() Some little known features
Posted: Thu Aug 27, 2009 06:33 AM
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
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: XBrowse() Some little known features
Posted: Thu Aug 27, 2009 06:54 AM
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.
Regards



G. N. Rao.

Hyderabad, India

Continue the discussion