TheSwamp
Code Red => AutoLISP (Vanilla / Visual) => Topic started by: velasquez on March 20, 2017, 09:01:56 PM
-
In my language there are words like "Tê" "Válvula" "pé"
I'm having problems with working with vl-sort
(vl-sort '(("Tubo" "Tê" "Tão" "Válvula" "Registro")) '(lambda (a b) (< (cadr a) (cadr b))))
;;;Returns -> (("Tubo" "Tê" "Tão" "Válvula" "Registro"))
;;; In my language, the return must be like -> '(("Tão" "Tê" "Tubo" "Registro" "Válvula"))
Can someone give me a way?
-
Forgive me but what language is it? :)
-
Forgive me but what language is it? :)
I'd guess Portuguese or Spanish.
-
Hi,
I don't know why you have a single list nested in a single list, but what you need is simply sort the 'car' of the parent list:
which is the same as
(list (vl-sort '
("Tubo" "Tê" "Tão" "Válvula" "Registro") '
<))
-
use acad_strlsort
-
;;; In my language, the return must be like ...
Can someone give me a way?
I fear that there is no common solution :-(
For me, the only unique sorting order is "a-z" and "0-9...". All other can be discussed and defined. Is it
- "A a B b" or "a A b B"
- "a ä" or "ä a" or "a-z ä" (German Umlaute)
- "â a á à or á a à â or ....(other diacritics)
- what's about the letters which are beyond a-z? (IIRC "ck" is an own letter in Czech ....)
So maybe you have to code it for every special character ....
-
Hi,
I don't know why you have a single list nested in a single list, but what you need is simply sort the 'car' of the parent list:
which is the same as
(list (vl-sort '
("Tubo" "Tê" "Tão" "Válvula" "Registro") '
<))
This list is part of a larger list.
-
Forgive me but what language is it? :)
My language is Portuguese.