FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour xBrowse and array
Posts: 312
Joined: Sat Oct 08, 2005 09:12 AM
xBrowse and array
Posted: Wed Jan 14, 2009 09:11 AM

Hi all,

i have a 4 column xBrowse over an array.

1.)
After adding or deleting array elements i want to 'reset' the browse.

I am uncertain if i have to do :
oBrw:SetArray( aArray )
or
oBrw:aArrayData := aArray
or both ( if yes, which must be called first ? )

2.)
The xBrowse is set with AUTOCOLS and AUTOSORT.
I found out that if i rebuild the array my column headers names change to Col1, Col2 ....
and the sort order is wrong.

How can i call the browse sort process?

Thanks for all assistance.
Regards,
Detlef

Posts: 682
Joined: Tue Feb 14, 2006 09:48 AM
Re: xBrowse and array
Posted: Wed Jan 14, 2009 10:28 AM
In my opinion calling SetArray it's the only necesary thing to do.
But it's not 100% true, it's depends of what version are using you.
On the last version FWH0812,
* Fix: Class TXBrowse Method SetArray() is properly assigning ::aArrayData in those cases that the
new assign array has the same structure as the previous used one.

I don't remeber exactly what version have this bug, but I remember I had to change SetArray to direct assign into aArrayData, in the actual version this bug are fixed.
Saludos desde Mallorca
Biel Maimó
http://bielsys.blogspot.com/
Posts: 312
Joined: Sat Oct 08, 2005 09:12 AM
Re: xBrowse and array
Posted: Wed Jan 14, 2009 12:22 PM
Biel,

many thanks for your answer.
In the meanwhile a made some more tests.

I use FWH 8.12.
Your are right, it's only necessary to call oBrw:SetArray( aArray ) to change the data source.

Except there is one glitch :-)
if the array is of lenght 0 you have to code additionally oBrw:aArrayData := aArray.
Otherwise your program will crash.
May be Antonio might fix this.

Thanks again, Biel,

regards,
Detlef

Continue the discussion