WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

Functions

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

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
File Created: 2001:01:12:10:55:30
Last Updated: 2001:01:12:10:55:30