...

View Full Version : if...else statements with multiple conditions



mightypants
06-17-2008, 05:40 AM
I want a function to intiate only if 2 different conditions are met. Would the syntax for this be....

if (condition1) && (condition2)
function ()


?

Thanks.

whizard
06-17-2008, 05:51 AM
yes..

rangana
06-17-2008, 06:07 AM
Maybe it's No, and is suppose to be like this instead:


if(condition1&&condition2)
myfunc();


or


if((condition1) && (condition2))
myfunc();


If nothing happens, up the code so we could play with it.

mightypants
06-17-2008, 06:12 AM
rangana,

Both of the ones you suggested worked, mine did not. Thanks.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum