Tuesday, August 18, 2009

Parcel Volume Report – Sorting (Revised)

Sometimes you think you have something correct, but find out later that it doesn’t do what you want. In this case I used a small sample set so I didn’t realize the sorting was alphanumeric and not numeric. So the parcels where sorted not exactly like it should have been.

1, 32, 102, 301, 4, 2 Is sorted as: 1, 102, 2, 301, 32, 4 which obviously not what is wanted.

To correct this to have it sort correctly I used this webpage to add to the code. It took some time to translate the post to, but I was finally able to do it. The code now sorts it as we would expect: 1, 2, 4, 32, 102, 301.


The completed class may be found here:

No comments:


Blog Widget by LinkWithin