Shoutbox

IF/OR statements - Printable Version

-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Messenger Plus! for Live Messenger (/forumdisplay.php?fid=4)
+---- Forum: Scripting (/forumdisplay.php?fid=39)
+----- Thread: IF/OR statements (/showthread.php?tid=81852)

IF/OR statements by ArkaneArkade on 02-23-2008 at 07:27 PM

Hey Folks

Sorry to ask about such a simple thing, but I can't seem to find it anywhere.  I have need of an OR statement, but I can't seem to find how to do it.

Basically I need to make an IF where Term A is met, and either Term B or Term C & D is/are also met.

can anyone tell me how to do this without using nested IFs, because I'ts to perform a lot of code, and I don't want to have it appearing twice.  I've tried using "OR" but that didn't work.  Is there a term I'm missing, or is it completely impossible?

Cheers all
Leroux


RE: IF/OR statements by vikke on 02-23-2008 at 07:28 PM

http://www.w3schools.com/js/js_comparisons.asp
Search for the OR-operator.


RE: IF/OR statements by Voldemort on 02-23-2008 at 07:57 PM

||  <-or
&& <- and

|
V yes, and what dead say


RE: IF/OR statements by deAd on 02-23-2008 at 07:58 PM

code:
if(Term A && (Term B || (Term C && Term D))) {
That if statement will execute if Term A is true, and either Term B is true or Term C and D are both true.
RE: IF/OR statements by ArkaneArkade on 02-23-2008 at 09:08 PM

Thank you very much guys.  Vikke: Link saved, cheers.  Voldemort and Dead, cheers v much. :D