Jump to content

Else if conditions


leso9903

Recommended Posts

Hello, I'd like to know if it's possible to set several conditions for an else if statement.

This I know I can do:

if (X==" ") {blabla} else {}

But I'd like several statements like so:

if (X==" " and Y==5 and Z==6) {blabla } else {}

How do I do that?

 

 

 

Link to comment
Share on other sites

Where you are using the word "and", use the logical and operator instead:

 

if (X==" " && Y==5 && Z==6) {

 

For what it's worth, the logical or operator looks like this:

 

||

Link to comment
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
×
×
  • Create New...