How to reference xBrowse columns

How to reference xBrowse columns

Postby hua » Wed May 23, 2018 3:20 am

Hi,

1. I prefer to reference a column using its header name but if some of the header names are the same as shown below how to refer to it?

Image

2. So far I know a column can be referenced using
a. oBrw:oCol(<column header>) or
b. oBrw:<column header>

How to code using method (b) if the header has spaces?

TIA
FWH 11.08/FWH 19.12
BCC5.82/BCC7.3
xHarbour/Harbour
hua
 
Posts: 1072
Joined: Fri Oct 28, 2005 2:27 am

Re: How to reference xBrowse columns

Postby nageswaragunupudi » Wed May 23, 2018 3:44 am

Till the browse is displayed we can refer to them in the order of creation as oBrw:aCols[ n ]. But once the browse is displayed, in other words, during runtime, we should not refer to them like this because user may shuffle the order of the columns as he likes.

During runtime:
oBrw:oCol( <nCreationOrder> ) Eg. oBrw:oCol( 3 ). 3 is the position when the browse is first setup.
oBrw:oCol( <cHeaderName> )
oBrw:<cHeaderName>

If the header name contains spaces or CRLF, we can omit them.
Example: if the Header is "First Name", following are valid:

oBrw:oCol( "FIRST name" )
oBrw:oCol( "firstname" )
oBrw:oCol:firstname.

When there are duplicate names, it is safer to refer them with nCreationOrder.

There can be same header name under different group headers.

We can also refer as:
oBrw:oCol( <groupname>_<headername> )
oBrw:<groupname>_<headername>

Example:
Groups "SALES", "PURCHASES" each having column headers "NORTH","EAST","WEST","SOUTH".

Then we can refer them as:

oBrw:Sales_south
oBrw:purchases_north
Regards

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

Re: How to reference xBrowse columns

Postby hua » Wed May 23, 2018 3:51 am

Thank you very much Rao!
FWH 11.08/FWH 19.12
BCC5.82/BCC7.3
xHarbour/Harbour
hua
 
Posts: 1072
Joined: Fri Oct 28, 2005 2:27 am


Return to FiveWin for Harbour/xHarbour

Who is online

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