954,549 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Multiple conditions in one IF statement?

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

Atlantistwo
Newbie Poster
7 posts since Sep 2007
Reputation Points: 10
Solved Threads: 0
 

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

Atlantistwo
Newbie Poster
7 posts since Sep 2007
Reputation Points: 10
Solved Threads: 0
 

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

BreadLoser
Newbie Poster
3 posts since Aug 2007
Reputation Points: 10
Solved Threads: 0
 

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

}
else
{

}

maulikmaruti
Newbie Poster
1 post since Jun 2010
Reputation Points: 10
Solved Threads: 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.

__avd
Posting Genius (adatapost)
Moderator
8,648 posts since Oct 2008
Reputation Points: 2,136
Solved Threads: 1,241
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You