FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour About oBrw:AddColumn
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
About oBrw:AddColumn
Posted: Fri Mar 28, 2008 12:04 AM

Marco,

>ADD TO oBrw BITMAP DATA aArray[oBrw:nAt(),1]

Try looking at the PPO file.

James

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
About oBrw:AddColumn
Posted: Fri Mar 28, 2008 12:21 PM
While we need to write this kind of code for twbrowse or tcbrowse, xbrowse made browing arrays very simple.

The command :
@ 0,0 XBROWSE oBrw OF oWnd ARRAY aData AUTOCOLS

is all that is needed to browse the entire array.

If we like to browse only selected columns, say 3rd, 2nd and 5th columns only of the array
@ 0,0 XBROWSE oBrw ;
        COLUMNS 3, 2, 5 ;
        HEADERS "First", "Second", "Third" ;
        OF oWnd ;
        ARRAY aData

is enough. Even the array elements can be of any datatype, xbrowse handles the necessary conversions.

If we still want to use the traditional tcbrowse command syntax, that is also possible to add columns ( even to insert the new column ).

If we prefer to continue the old TXBrowse way of using methods and data,

oCol := oBrw:AddCol()
oCol:nArryCol := 5   // this is enough
// Instead of the earlier 
// oCol:bStrData := {|| cValToChar( oBrw:aArrayData[ oBrw:nArrayAt ] ) }
// Writing this for eacj column
// or looping through the array to build the blocks taking advantage of detached locals


No need to code with oBrw:aArrayData oBrw:nArrayAt or oBrw:nAt(), etc. though thiose options are still available if we enjoy writing long pages of code.

In addition we have facilities like autosort, report, export to excel, etc.

Xbrowse command syntax is almost similar to ListBox and TCBrowse syntaxes, so that we write the code the familiar way but in just a fewer lines than what is necessary with earlier xbrowse or its elder brothers wbrowse or tcbrowse.

When I am converting my earlier xbrowse code using the new facilities, multiple pages of code is now fitting into a page or less. Better readability and easy to maintain.

8.03 allows browsing blank recordsets. Wish we can browse blank arrays too in some way.
Regards



G. N. Rao.

Hyderabad, India
Posts: 6983
Joined: Fri Oct 07, 2005 07:07 PM
About oBrw:AddColumn
Posted: Fri Mar 28, 2008 12:48 PM

Mr. NageswaraRao,
Thank very much you for your work continues work for xBrowser.

In our language exists a proverb:
“A picture says more than a thousand words”.
Therefore I would like to ask you if you would be so kind to post
some samples with the new syntax.
Thanks in advance
Otto

Posts: 858
Joined: Fri Oct 07, 2005 12:00 PM
About oBrw:AddColumn
Posted: Fri Mar 28, 2008 03:30 PM

Solved. Thank you.

I already use the standard tcbrowse at this moment but I am waiting the next FWH stable release to migrate to xBrowse.

Thank to your excellent work NageswaraRao.

Best Regards,



Marco Turco

SOFTWARE XP LLP
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
About oBrw:AddColumn
Posted: Sat Mar 29, 2008 09:03 AM

Marco,

The current FWH 8.03 build is totally stable :-)

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 858
Joined: Fri Oct 07, 2005 12:00 PM
About oBrw:AddColumn
Posted: Sat Mar 29, 2008 12:44 PM

Well, I will order you the update on the next days

:D

Best Regards,



Marco Turco

SOFTWARE XP LLP

Continue the discussion