1.11M Members

Multiple conditions in one IF statement?

 
0
 

Hey guys I was wondering if there was a way to have more than one condition in an IF statement.
Thanks

 
0
 

Ok I found it... You have to use the AND operator "&&"... my bad.

Question Self-Answered as of 6 Years Ago
 
0
 

Don't forget that you can also use the OR operator "||" for situations where you only care if one condition is true/false.

 
0
 

if ((fileExt == ".mp4")|| (fileExt ==".mpg") ||(fileExt ==".avi"))
{

}
else
{

}

 
0
 

maulikmaruti.

Please do not resurrect threads that are years old. By doing so you run the risk of confusing current posters. Have a look at forum rules.
Please read before posting - http://www.daniweb.com/forums/thread78223.html

Thread Closed.

You
This question has already been solved: Start a new discussion instead
Post:
Start New Discussion
Tags Related to this Article