Page 1 of 1

XBROWSE : Method oCol(cHeader)

Posted: Sat Mar 10, 2012 8:55 am
by Demont Brecht
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

Re: XBROWSE : Method oCol(cHeader)

Posted: Sat Mar 10, 2012 11:32 pm
by nageswaragunupudi
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.