Arrays and tSBrowse

Arrays and tSBrowse

Postby TimStone » Thu Jan 31, 2008 1:47 am

OK ... I found a work around, but still ....

Using tSBrowse with an array. Initially it has x number of elements ( for example 10) and browsing them is no problem. Now, I wish to add another element, so I use AADD( ) and increase the array by one element. I now need to reposition the highlight to the new element so I do a oLbx:gobttom() ... but that doesn't necessarily get there ! The array elements are in natural order, not sorted. So, using the tSBrowse gobottom() method I would think should take me there ...

Any thoughts ?

For my work around, I count the number of array elements, and then use the GoPos( x, y ) method to go to the last array element. That seems to work.

I'm using this to append elements to the array, and then they will be written to a database after editing is complete.

8)
Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
User avatar
TimStone
 
Posts: 2944
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA

Postby Detlef Hoefner » Thu Jan 31, 2008 8:05 am

Tim,

may be this could work.
Code: Select all  Expand view
oBrw:bGoBottom := { || oBrw:nAt := len( oBrw:aArray ) }


Regards,
Detlef
User avatar
Detlef Hoefner
 
Posts: 312
Joined: Sat Oct 08, 2005 9:12 am
Location: Germany

Re: Arrays and tSBrowse

Postby mmercado » Thu Jan 31, 2008 4:07 pm

TimStone wrote:using tSBrowse with an array. Initially it has x number of elements ( for example 10) and browsing them is no problem. Now, I wish to add another element, so I use AADD( ) and increase the array by one element. I now need to reposition the highlight to the new element so I do a oLbx:gobttom() ... but that doesn't necessarily get there ! The array elements are in natural order, not sorted. So, using the tSBrowse gobottom() method I would think should take me there ...

Any thoughts ?


Hi Tim:

If you externally add an element to the array, must to add 1 to oBrw:nLen data, or use SetArray() method to refresh the array size and view.

Regards.

Manuel Mercado
User avatar
mmercado
 
Posts: 782
Joined: Wed Dec 19, 2007 7:50 am
Location: Salamanca, Gto., México


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 77 guests

cron