>
> Hmm, that's interesting.  I had assume that it was because during the
> sort, the native code had to call back into the interpreter so often, so
> quickly.
>
> Could I see your sortListView method?  Also what are you using for the
> user data items for the list-view items?
>
>
Sure. This should answer your two questions. As you can see the method is
almost identical to yours, with the addition that a conversion of the data
is always performed, this should "slow down" the process somewhat. On the
other hand, your code is not a sort program but a ProgressBar example which
is illustrated quite well. But it's not a good sorting example ;)

BTW, maybe you can suggest a more elegant way to sort a numeric column. I
guess I could add an overriding class similar to what Rick suggested with
his caselessIndex class, whether more elegant in this case I don't know...


::METHOD sortListView
  expose numericColumn
  use strict arg data1, data2, parms
   -- data1/2 are arrays, parms is a directory

  column = parms~column + 1
  -- Make relative to 1

  if numericColumn[column] then
     if parms~ascending then
        return right(data1[column], digits(),
"0")~compareTo(right(data2[column], digits(), "0"))
     else
        return right(data2[column], digits(),
"0")~compareTo(right(data1[column], digits(), "0"))
  else
     if parms~ascending then
        return
.Encoding~convert(data1[column])~compareTo(.Encoding~convert(data2[column]))
     else
        return
.Encoding~convert(data2[column])~compareTo(.Encoding~convert(data1[column]))

Staffan
------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_feb
_______________________________________________
Oorexx-users mailing list
Oorexx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/oorexx-users

Reply via email to