Page 1 of 1

Change the columns order with xBrowse

Posted: Wed Sep 05, 2007 7:54 am
by Marco Turco
Hi,
I succesfully replaced the fwh tcbrowse with xbrowse that is more flexible.

I only have the problem to change the order of colums,
for example with an array like:

{"Mark","11-11-2007","3:45"}
{"Luc","4-5-2004","11:37"}

if I want to display the second,third and first element in twbrowse I can do it with

ADD COLUMN TO oBrw DATA ARRAY ELEM 2
ADD COLUMN TO oBrw DATA ARRAY ELEM 3
ADD COLUMN TO oBrw DATA ARRAY ELEM 1

but how can I do the same with xBrowse ?

Thanks in advance.

Best Regards,

Marco Turco

Posted: Wed Sep 05, 2007 8:16 am
by demont frank
See

http://fivetechsoft.com/forums/viewtopi ... ht=xbrowse

This error was reported with corection

No reaction

Frank

Posted: Wed Sep 05, 2007 9:40 am
by Antonio Linares
Frank,

Already implemented. We simply missed it. Thanks! :-)

Posted: Wed Sep 05, 2007 9:54 am
by Marco Turco
Yes,
but what is the way to display the columns with the order

ELEM 2
ELEM 3
ELEM 1

instead the default
ELEM 1
ELEM 2
ELEM 3

?

Posted: Sat Sep 08, 2007 4:08 pm
by Demont.frank
Otto

ELEM 2
ELEM 3
ELEM 1

instead the default
ELEM 1
ELEM 2
ELEM 3

WITH OBJECT oBrw
:Swapcols(:aCols[1],:aCols[2]) ; :Swapcols[:aCols[2],:aCols[3])
END

Or look at oBrw:setarray to see how oBrw:bstrdata is set

oCol := :aCols[1]
oCol:bStrData := GenArrayBlock( { || :aArrayData[ :nArrayAt ] },2, .t. )

oCol := :aCols[2]
oCol:bStrData := GenArrayBlock( { || :aArrayData[ :nArrayAt ] },3, .t. )

oCol := :aCols[3]
oCol:bStrData := GenArrayBlock( { || :aArrayData[ :nArrayAt ] },1, .t. )

GenArrayBlock is STATIC and must be changed or copied