PDA

View Full Version : search a list of character codes after you converted them with vl-string->list



cadking2k5683822
2017-02-12, 01:45 AM
How do I search this list now to see if any of them are equal to another number or symbol
(setq ts (vl-string->list tx)
(64 53 60 49 51 53)

BIG-AL
2017-02-19, 01:00 AM
Not sure why you did not get a reply any way. 1 way



(setq ts (vl-string->list tx)
(repeat (setq x (length ts))
(if (= num (nth (setq x (- x 1)) ts)) ; lists start at 0
(alert "num found") ;do your thing here.
)
)

Tom Beauford
2017-02-20, 02:03 PM
Weird don't remember seeing that one before. 1 more way
(if (member num ts) ;do your thing here.