Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Community Member

multiple or(double pipe) in if step

I want to use only one if step to achieve coupld "or" function, can I do this? For example if the number is A1 or A2 or A3 goes to labelA. thanks. I know I can use 1 or(|| double pipe). How about multiple double pipe in one if step? thanks

3 REPLIES
Hall of Fame Super Silver

Re: multiple or(double pipe) in if step

Yes it will work just fine. I am doing the same.

The only thing to make sure of is to use the varaible all the time. For example:

if (x==1 || x==2) then ... <-- OK

if (x==1 || ==2) then ... <-- Not OK

Chris

Community Member

Re: multiple or(double pipe) in if step

Thanks. Can I do three or four? like if (x==1 || x==2 || x=3) ?

Hall of Fame Super Silver

Re: multiple or(double pipe) in if step

Absolutely, I don't know what the limit is, you can try. I have a script with if statement that has 5 ||'s.

Chris

620
Views
10
Helpful
3
Replies
CreatePlease to create content