Like-Operator/Placeholder for Numbers?

Like-Operator/Placeholder for Numbers?

mmP3TWV
Participant Participant
267 Views
3 Replies
Message 1 of 4

Like-Operator/Placeholder for Numbers?

mmP3TWV
Participant
Participant

Hi I am quite a beginner and want to merge a bunch of Layers 

 

Therefore I need an if-Routine to filter my Layers by Name

 

My Problem ist that 

(= 01AAA 01###) is True

(= 01AAA 01*) is True

BUT

(= 01222 01###) is nil

(= 01222 01*) is nil

AND even (= "01222" 01###) is nil...

 

How can I Filter my Layernames 01111, 01122 01129....?

Or is it possible that I don't have the Issue when I work with my String out of Layernames because it wil treat the String-numbers differently and therefore (= 01222 01###) allready is true?

 

 

 

 

 

0 Likes
Accepted solutions (2)
268 Views
3 Replies
Replies (3)
Message 2 of 4

ВeekeeCZ
Consultant
Consultant
Accepted solution

 

(wcmatch "01222" "01###")
T
(wcmatch "01222" "01*")
T


(wcmatch "01AAA" "01###")
nil
(wcmatch "01AAA" "01@@@")
T
(wcmatch "01222" "01###")
T

Message 3 of 4

komondormrex
Mentor
Mentor
Accepted solution

hey,

you can't compare symbols using wildcards.

(= 01AAA 01###) is true because both symbols are nil

(= 01AAA 01###) same

(= 01222 01###) nil because  01222 is number (t), but 01### symbol is nil

(= 01222 01*) same

(= "01222" 01###) nil because "01222" is string  (t), but 01### symbol is nil

look at wcmatch function to use wildcards

 

Message 4 of 4

mmP3TWV
Participant
Participant

Thank you. I see now, what I misunderstood.

0 Likes