About oBrw:AddColumn

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

Post by James Bott »

Marco,

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

Try looking at the PPO file.

James
User avatar
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Post by nageswaragunupudi »

While we need to write this kind of code for twbrowse or tcbrowse, xbrowse made browing arrays very simple.

The command :

Code: Select all

@ 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

@ 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

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
Otto
Posts: 4470
Joined: Fri Oct 07, 2005 7:07 pm
Contact:

Post by Otto »

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
Marco Turco
Posts: 858
Joined: Fri Oct 07, 2005 12:00 pm
Location: London
Contact:

Post by Marco Turco »

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
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

Marco,

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

Antonio Linares
www.fivetechsoft.com
User avatar
Marco Turco
Posts: 858
Joined: Fri Oct 07, 2005 12:00 pm
Location: London
Contact:

Post by Marco Turco »

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

Marco Turco
SOFTWARE XP LLP
Post Reply