Message 1 of 13

Not applicable
04-30-2018
04:06 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I'd like to sort a list of dotted pairs based on their key. I'm using this chunk of code I found on the Autocad website.
(SETQ LIST (VL-SORT LIST '(LAMBDA (b a) (< (CAR b) (CAR a)) ) ) )
_$LIST
((10'-0" . 4.0) (11'-0" . 2.0) (12'-0" . 4.0) (8'-4 3/4" . 18.0) (8'-6" . 4.0) (9'-6" . 4.0))
I think I see how its sorting them. . . That's just not what I want. I'd like them to start with the smallest value. Lisp is new to me, so it's probably something really simple. I'll eventually use these key/values to populate a table. I'm not sure if that consideration is important. But it's something to keep in mind.
Thanks for any input.
Solved! Go to Solution.