Wilson WindowWare Tech Support

WinBatch WinBatch+Compiler WebBatch
Home | Tech Database | Tech BBS | White Papers | Purchase


Reverse Sort Order for ItemSort

Keywords:   ItemSort Example

Question:

Is it possible to have ItemSort do a reverse sort of the list, ordering things from largest to smallest?

Answer:

Sorry no.

This might help getting a reverse sort...

List="apple fred bannana togas pineapple zuchinni meatloaf"

listA=ItemSort(list," ")
askItemList("Normal Sort",listA," ",@unsorted,@single)

count=ItemCount(ListA," ")

ListB=""
for xx=count to 1 by -1
   Item=ItemExtract(xx,ListA," ")
   if xx==count then ListB=Item
   else ListB=Strcat(ListB," ",Item)
next

askItemList("Reverse Sort",listB," ",@unsorted,@single)

Reply

Thanks! That does the trick in this case (and probably most others).



Article ID:   W14596
Filename:   ItemSort Reverse Sort Order.txt