XBrowse() Some little known features

XBrowse() Some little known features

Postby nageswaragunupudi » Thu Aug 27, 2009 4: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: 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.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10625
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: XBrowse() Some little known features

Postby anserkk » Thu Aug 27, 2009 5:44 am

Dear Mr.Rao,

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

Regards
Anser
User avatar
anserkk
 
Posts: 1332
Joined: Fri Jun 13, 2008 11:04 am
Location: Kochi, India

Re: XBrowse() Some little known features

Postby Otto » Thu Aug 27, 2009 6: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
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6328
Joined: Fri Oct 07, 2005 7:07 pm

Re: XBrowse() Some little known features

Postby nageswaragunupudi » Thu Aug 27, 2009 6: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
User avatar
nageswaragunupudi
 
Posts: 10625
Joined: Sun Nov 19, 2006 5:22 am
Location: India


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 98 guests