Sign in to follow this  
Followers 0
gleem

Possible for a either or statement?

5 posts in this topic

#1 ·  Posted (edited)

in an If... Then... statement, is it possible to use either or...

such as

If $var = $name1 or &name2 Then

Msgbox(0,"Success", "Sucess")

endif

Edited by gleem

Share this post


Link to post
Share on other sites



in an If... Then... statement, is it possible to use either or...

such as

If $var = $name1 or &name2 Then

Msgbox(0,"Success", "Sucess")

endif

Like just an 'or' statement?

If $var=$name1 or $var=$name2 then
    MsgBox(0,"OK",OK")
Endif

Share this post


Link to post
Share on other sites

;You have to do it this way:

If ($variable = $name1) or ($variable = $name2) Then

MsgBox(0,"test","test")

EndIf

ok.. that works.... now.... is it possible to have more than 2 checks.. for example

If ($variable = $name1) or ($variable = $name2) or ($variable = $name3) or ($variable = $name4) Then

MsgBox(0,"test","test")

EndIf

Share this post


Link to post
Share on other sites

Yes, it is possible to have more than 2 checks.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0