Page 1 of 1

Browse refresh after array shrinkage

Posted: Sat Jan 03, 2015 2:17 am
by Janko
Dear Roger,

while resizing array during BROWSE I usually used following code for refreshing :

Code: Select all

   IF Valtype(oBr) = 'O'
      DC_GetBrowArray( oBr, aRRc )
      oBr:refreshAll()
   ENDIF
Lately I found out, that in case:
1. during BROWSE array is shrinked from 51 to 48 rows
2. browse pointer is left on 51 row
3. the following error is generated
4. if browse pointer is left inside 48 rows, everything goes fine

I addapted refreshing of BROWSE in following way:

Code: Select all

   IF Valtype(oBr) = 'O'
      DC_GetBrowArray( oBr, aRRc )
	  if (nPt>nLn,obr:goBottom(),)    // browse pointer is pushed to new bottom row
      oBr:refreshAll()
   ENDIF
Array (aRRc) is always created via cloning.
Do you have any suggestion?

Best regards
JAnko

Re: Browse refresh after array shrinkage

Posted: Sat Jan 03, 2015 10:30 am
by rdonnay
That will certainly work fine.

Here is another option:

oBrowse:arrayElement := Min(oBrowse:arrayElement,Len(oBrowse:dataSource))