• This forum is the machine-generated translation of www.cad3d.it/forum1 - the Italian design community. Several terms are not translated correctly.

find the difference between 2 lists with many strings

  • Thread starter Thread starter x11start
  • Start date Start date

x11start

Guest
I have two lists with many strings and I would like to extract the difference by placing them in a new list. it is possible to do so easily (maybe with a vl-xxx command) without having to compare item by item using foreach and member?
basically I would like to compare ("aaa" "bbb" "ccc" "ddd" "eee") with ("aaaa" "ddd" "eee") and get a list containing ("bbb" "ccc").
(I have put them only to highlight).
Thank you.
 
thanks rpor...
When I have a moment of time I will try the various solutions... and then I will share the lisp for which I needed this routine.
 
.... I finally chose the solution of lee mac (scusa rpor!)

the lisp that I attached, serves to highlight the variables "orphans" (i.e. not placed at nil out), of my lisp.
basically use is this:

; - open autocad
; - launch this lisp: list will be created [imath]lisainiz[/imath]; - perform the lisp you want to analyze: so that if this tax
; variables (only the numbers, not the strings!) and does not put them out, you will be able to detect.
; - launch this lisp again: list will be created [imath]listafin[/imath] and compare the 2 lists

in the initial question I had placed as an example of string lists.... while here only the numerical variables are detected ( hence the name "listnums")!
At this point, I ask your help to extract even the string values: I suppose the key is in a different value of atoms-family. . . .
 

Attachments

Forum statistics

Threads
44,997
Messages
339,767
Members
4
Latest member
ibt

Members online

No members online now.
ciao
Back
Top