FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour XBROWSE : Method oCol(cHeader)
Posts: 55
Joined: Fri Jul 08, 2011 06:43 AM
XBROWSE : Method oCol(cHeader)
Posted: Sat Mar 10, 2012 08:55 AM

Hello ,

Looking in the source from xbrowse , i see :

METHOD oCol( u ) CLASS TXBrowse
local nAt := AScan( ::aCols, { |o| o == u } )

Calling this method , u will be a character expression , so we have left from == a column object , right a character expression.

I tryed with oBrw:aCols[1]=="First" (column header) , and indeed this works and gives .T.

Trying the same with another object ( oBrw=="First") , gives as expected an error , also when data cExpr is added to the browse.

Why this sort of compare is possible with a column object , not with others ?

Frank

Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: XBROWSE : Method oCol(cHeader)
Posted: Sat Mar 10, 2012 11:32 PM

TXBrwColumn has overloaded operator "==", to make internal coding easy.
As for as the user is concerned:
oBrw:oCol( cHeader ) --> Column object having cHeader as its Header
oBrw:oCol( nCreationOrder ) --> Column object whose creation order is nCreationOrder.
oBrw:oCol( oCol ) --> same column.

Regards



G. N. Rao.

Hyderabad, India

Continue the discussion