search a list of character codes after converting it with vl-string->list

search a list of character codes after converting it with vl-string->list

cadking2k5
Advocate Advocate
850 Views
4 Replies
Message 1 of 5

search a list of character codes after converting it with vl-string->list

cadking2k5
Advocate
Advocate
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)
0 Likes
851 Views
4 Replies
Replies (4)
Message 2 of 5

john.uhden
Mentor
Mentor

Well, now you have a list of integers.

How about (vl-position 60 '(64 53 60 49 51 53))?

But at that rate you could just use (vl-string-search "<" tx) on the original string.

Does that help?

John F. Uhden

0 Likes
Message 3 of 5

cadking2k5
Advocate
Advocate

In the command I don't have (64 53 60 49 51 53) that is just what tx is.

But the (vl-string-search "<" tx) helped

Thank you

0 Likes
Message 4 of 5

Kent1Cooper
Consultant
Consultant

@cadking2k5 wrote:
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)

(member AnotherNumberOrSymbol '(64 53 60 49 51 53))

Kent Cooper, AIA
0 Likes
Message 5 of 5

john.uhden
Mentor
Mentor

I recall doing some time testing years ago and found that vl-position is like twice as fast as member.

Never mind that.  I just tested and the times are virtually the same.

John F. Uhden

0 Likes