About oBrw:AddColumn

Postby James Bott » Fri Mar 28, 2008 12:04 am

Marco,

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

Try looking at the PPO file.

James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Postby nageswaragunupudi » 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 :
Code: Select all  Expand view
@ 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
Code: Select all  Expand view
@ 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,

Code: Select all  Expand view
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
User avatar
nageswaragunupudi
 
Posts: 10624
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Postby Otto » 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
User avatar
Otto
 
Posts: 6328
Joined: Fri Oct 07, 2005 7:07 pm

Postby Marco Turco » Fri Mar 28, 2008 3: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
User avatar
Marco Turco
 
Posts: 858
Joined: Fri Oct 07, 2005 12:00 pm
Location: London

Postby Antonio Linares » Sat Mar 29, 2008 9:03 am

Marco,

The current FWH 8.03 build is totally stable :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42080
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Marco Turco » Sat Mar 29, 2008 12:44 pm

:D Well, I will order you the update on the next days
Best Regards,

Marco Turco
SOFTWARE XP LLP
User avatar
Marco Turco
 
Posts: 858
Joined: Fri Oct 07, 2005 12:00 pm
Location: London

Previous

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: cmsoft, Google [Bot] and 93 guests