Re: When can I use "OR"
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.php archive

Re: When can I use "OR"

From: Smitro <nospam@myh0use.c0m>
Date: Fri Sep 16 2005 - 11:30:58 CEST

Cylindric wrote:
> Smitro wrote:
>
>>Hi,
>>
>>How come in some statements I can use:
>>
>>If (something) or DIE();
>>
>>but other times it won't work (returns an error) unless I take out the
>>OR.
>>
>>Is there any documentation on this anywhere?
>
>
> Think of it from a conversational point of view:
>
> PHP: "If (something) or DIE();"
> ENG: "If MyName=Fred Or Then DoSomething" makes no sense
>
> PHP: "If (something or somethingelse) Then Die();"
> ENG: "If MyName=Fred Or MyAge=92 Then DoSomething" makes sense
>
> PHP: "If (something) then DIE();"
> ENG: "If MyName=Fred Then DoSomething"
>

yep, got a point, I was trying to revese and if
statment, but then my other brain kicked in and
said, just stick some more brackets around it.

eg.
If ((something) and (something else)) or Die();

is now...

If (!((something) and (something else))) die();
Received on Tue Oct 18 02:24:22 2005