>lparameter pcOrder, plAscending > >local i, j, llLockScreen, lnRecno, lnRelativeRow, lnDirection, lcDescending > >llLockScreen = thisform.LockScreen && prevent user from seeing all of the jumping >thisform.LockScreen = .t. > >lnRecno = recno() >lnRelativeRow = this.RelativeRow >lcDescending = iif( ! plAscending, "descending", "ascending" ) >set order to pcOrder &lcDescending >this.Refresh() > >goto lnRecno && move record pointer back >this.Refresh() > >if ( lnRelativeRow != this.RelativeRow ) > * the record didn't wind up at the same grid row, so we scroll the grid > > lnDirection = iif( lnRelativeRow > this.RelativeRow, 0, 1 ) > j = abs( lnRelativeRow - this.RelativeRow ) > for i = 1 to j > this.DoScroll( lnDirection ) > endfor > > this.Refresh() && YAR >endif > >thisform.LockScreen = llLockScreen >>