lowercase alphabatizing in lists

Discussion in 'AutoCAD' started by trl11, Aug 5, 2003.

  1. trl11

    trl11 Guest

    Hi, I'm back for some more list sorting help. I need to get lowercase letters alphabatized. It doesn't seem to work with vl-sort and I haven't been able to find any other resources to help in solving the problem. I've listtosort that is (("2" "JZ's Motel") ("4" "The Four Seasons") ("5" "tb hobb's house") ("3" "Joe's Motel") ("1" "Holiday Inn")). After using this code (setq listtosort (vl-sort listtosort (function (lambda (a b) (< (nth 1 a) (nth 1 b)))))) I get (("1" "Holiday Inn") ("2" "JZ's Motel") ("3" "Joe's Motel") ("4" "The Four Seasons") ("5" "tb hobb's house")) As you can see "tb hobb's" should be before "The Four Seasons". And the same with "JZ's" and "Joe's". Any ideas. Does a whole new alphabitization scheme have to be coded to include lowercase values? Thanks a milion, Tim
     
    trl11, Aug 5, 2003
    #1
  2. trl11

    trl11 Guest

    Great. Love it. Thanks Ken. Now to push it one step further, is there a way to sort initialed names along with non-initialed names. J.P. Morgan before JZ's Motel?
     
    trl11, Aug 5, 2003
    #2
  3. It already does. and You're welcome.

    --
    Ken Alexander
    Acad2000
    Windows2000 Prof.

    "We can't solve problems by using the same kind
    of thinking we used when we created them."
    --Albert Einstein

    there a way to sort initialed names along with non-initialed names.
    J.P. Morgan before JZ's Motel?
     
    Ken Alexander, Aug 6, 2003
    #3
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.