Brilliant Andre. I am betting though that the problem occurs in the code that calls this function. I am going to wait until Trevor finds the source and releases an update for the dataGrid.
Bob On Aug 16, 2011, at 9:14 AM, Andre Garzia wrote: > On Tue, Aug 16, 2011 at 1:09 PM, Andre Garzia <an...@andregarzia.com> wrote: > >> >> >> On Tue, Aug 16, 2011 at 12:58 PM, Andre Garzia <an...@andregarzia.com>wrote: >> >>> the error is not on sorting, it is on: >>> >>> _table.DrawColumns >>> >>> some error in an object reference... odd... only when ascending, the >>> descending sort works. >>> >> >> >> I think I found it. When sorting ascending, the pIndexesToDraw variable >> which contains a comma separated list of indexes, has an extra comma like: >> >> ,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18 >> >> So it fails. I think I might have uncovered a bug somewhere >> > > > I've added the following code to the data grid library: > > ## Default is not to pass in value for pIndexes to draw in which case > ## we use the base sequence for visible controls to determine indexes > to draw > if pIndexesToDraw is not empty then > put itemOffset(item 1 of pIndexesToDraw, sIndexSequencing) - 1 into > theSequence > else > put item sTableObjectsA["base sequence for visible controls"] to \ > (sTableObjectsA["base sequence for visible controls"] + > sTableObjectsA["row control count"] - 1) of sIndexSequencing into > pIndexesToDraw > put sTableObjectsA["base sequence for visible controls"] - 1 into > theSequence > end if > > ## AAG: Below I fix a possible bug > repeat while char 1 of pIndexesToDraw is not a number > delete char 1 of pIndexesToDraw > if pIndexesToDraw is empty then > exit repeat > end if > end repeat > > > With that in place, everything starts working. > > >> >> >> >> -- >> http://www.andregarzia.com All We Do Is Code. >> > > > > -- > http://www.andregarzia.com All We Do Is Code. > _______________________________________________ > use-livecode mailing list > use-livecode@lists.runrev.com > Please visit this url to subscribe, unsubscribe and manage your subscription > preferences: > http://lists.runrev.com/mailman/listinfo/use-livecode _______________________________________________ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode