Display full version of the post: lisp

vasuchowdary200
29.03.2011, 14:37
actually i have parcelnumbers in sequential like 1 to 999
 
how can i find the missing number from that
 
is ther any lisp for that

Vladimir Michl
29.03.2011, 15:00
I am not aware of any. But you can export the texts (or attributes) to a text file, sort it, and find any gaps.

alanjt
29.03.2011, 22:43
A quick and dirty sub, but this will return any missing values in a list of numbers with a specified increment.[code](defun foo (numberlist inc / low high i lst)  (setq low  (apply 'min numberlist)        i    low        high (apply 'max numberlist)  )  (foreach x (cdr (vl-sort numberlist '<))    (if (/= x (setq i (+ inc i)))      (setq lst (cons i lst)            i   (+ inc i)      )    )  )  (reverse lst))[/code]eg.(foo '(1 3 5 6 7 5 8 9) 1) -> (2 4)


Vladimir Michl
05.04.2011, 10:42
You can use the SRXMISSING command from our updated srxText utility. See Download.