Click here to Skip to main content
16,011,804 members
Home / Discussions / Web Development
   

Web Development

 
AnswerRe: How can CGI be so difficult? Pin
benjymous7-Feb-03 4:57
benjymous7-Feb-03 4:57 
GeneralRe: How can CGI be so difficult? Pin
georgiek507-Feb-03 7:21
georgiek507-Feb-03 7:21 
GeneralIcon address toolbar Pin
marnicola6-Feb-03 9:53
marnicola6-Feb-03 9:53 
GeneralRe: Icon address toolbar Pin
David Wulff7-Feb-03 4:47
David Wulff7-Feb-03 4:47 
GeneralLDAP VBScript & ASP Pin
Robby6-Feb-03 8:24
Robby6-Feb-03 8:24 
QuestionAdding hidden form variables on client side? Pin
devvvy5-Feb-03 22:37
devvvy5-Feb-03 22:37 
QuestionWhich is correct? Pin
Vasudevan Deepak Kumar5-Feb-03 19:49
Vasudevan Deepak Kumar5-Feb-03 19:49 
AnswerRe: Which is correct? Pin
Paul Riley5-Feb-03 22:49
Paul Riley5-Feb-03 22:49 
Deepak Kumar Vasudevan wrote:
A < 0 AND B < 0 OR A > 0 AND B > 0.

I have written a code like.

IFF A<0 AND B<0 OR C>0 AND D>0. (ie.) even if A is greater than 0 and B is less than zero, it should not select records. So I coded like this.

I would just like to know whether the above is right or the below one which my colleage is insisting about (ie).

IFF (A>0 AND B>0) OR (C<0 AND D<0).


I admit I'm slightly confused because your condition seems to keep changing, but if you're just asking whether to use brackets or not then YES, use them, always and everywhere. It doesn't matter if they're unnnecessary, it makes them easy to read.

If you say
Condition1 AND Condition2 OR Condition3 AND Condition4
then it's impossible for me to know whether you intend to say
(Condition1 AND Condition2) OR (Condition3 AND Condition4) [AND precedence]
or
Condition1 AND (Condition2 OR Condition3) AND Condition4 [OR precendence]
or
((Condition1 AND Condition2) OR Condition3) AND Condition4 [NO precedence]

If I remember correctly, different languages will react different ways, but I put unnecessary brackets everywhere so I don't need to know if a given language requires the brackets or not.

Remember, the compiler will not act in a negative way when encountering unnecessary brackets, so what harm can there be in clarifying your intention?

Paul
And you run and you run to catch up with the sun, but it's sinking
Racing around to come up behind you again
The sun is the same in a relative way, but you're older
Shorter of breath, one day closer to death
- Pink Floyd, Time

Generalsecurity in ASP Pin
devvvy5-Feb-03 14:32
devvvy5-Feb-03 14:32 
GeneralRe: security in ASP Pin
David Wulff5-Feb-03 16:07
David Wulff5-Feb-03 16:07 
GeneralRe: security in ASP Pin
devvvy5-Feb-03 19:03
devvvy5-Feb-03 19:03 
GeneralRe: security in ASP Pin
David Wulff6-Feb-03 5:31
David Wulff6-Feb-03 5:31 
GeneralSILLY: HTML checkbox Pin
devvvy5-Feb-03 11:51
devvvy5-Feb-03 11:51 
GeneralRe: SILLY: HTML checkbox Pin
David Wulff5-Feb-03 16:10
David Wulff5-Feb-03 16:10 
GeneralRe: SILLY: HTML checkbox Pin
devvvy5-Feb-03 18:57
devvvy5-Feb-03 18:57 
GeneralRe: SILLY: HTML checkbox Pin
Richard Deeming6-Feb-03 0:40
mveRichard Deeming6-Feb-03 0:40 
GeneralTwo questions Pin
georgiek505-Feb-03 11:23
georgiek505-Feb-03 11:23 
GeneralRe: Two questions Pin
TigerNinja_6-Feb-03 4:21
TigerNinja_6-Feb-03 4:21 
GeneralRe: Two questions Pin
georgiek506-Feb-03 6:16
georgiek506-Feb-03 6:16 
GeneralTricky Page Reload Pin
Steven M Hunt5-Feb-03 11:05
Steven M Hunt5-Feb-03 11:05 
GeneralRe: Tricky Page Reload Pin
devvvy5-Feb-03 12:08
devvvy5-Feb-03 12:08 
GeneralRe: Tricky Page Reload Pin
Steven M Hunt5-Feb-03 13:33
Steven M Hunt5-Feb-03 13:33 
GeneralRe: Tricky Page Reload Pin
devvvy5-Feb-03 13:56
devvvy5-Feb-03 13:56 
GeneralPlease help and help me ...! Pin
Thuy Dinh4-Feb-03 20:00
Thuy Dinh4-Feb-03 20:00 
GeneralRe: Please help and help me ...! Pin
Christian Graus4-Feb-03 21:02
protectorChristian Graus4-Feb-03 21:02 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.