Click here to Skip to main content
15,905,587 members
Home / Discussions / C#
   

C#

 
AnswerRe: Is this a bug in .NET 2.0? Pin
Michael P Butler2-Nov-06 2:53
Michael P Butler2-Nov-06 2:53 
GeneralRe: Is this a bug in .NET 2.0? Pin
adfgh752-Nov-06 3:54
adfgh752-Nov-06 3:54 
Questionif statement Pin
fmardani2-Nov-06 1:57
fmardani2-Nov-06 1:57 
AnswerRe: if statement Pin
sam#2-Nov-06 2:16
sam#2-Nov-06 2:16 
AnswerRe: if statement Pin
J4amieC2-Nov-06 2:20
J4amieC2-Nov-06 2:20 
GeneralRe: if statement Pin
eggsovereasy2-Nov-06 3:30
eggsovereasy2-Nov-06 3:30 
GeneralRe: if statement Pin
J4amieC2-Nov-06 3:39
J4amieC2-Nov-06 3:39 
GeneralRe: if statement Pin
Andrew Rissing2-Nov-06 3:43
Andrew Rissing2-Nov-06 3:43 
The negation operator (!) has a higher precedence than the logical or operator. I think you made a typo yourself when you went from steps:

if(! (false && true) || (true && true))

To:

if( ! (false || true) )

Personally, I would suggest just using the debugger and putting a watch in to see what exactly is going in. Put the full statement "(!(intPosHomeUS > 0 && intPosHomeUK > 0) || (intPosHostUK > 0 && intPosHostUS > 0))" and then break it down into pieces to find the error.

As a side note, I'm not a big fan of putting a negation like that because it always seems to trip me up (may just be me). So, I typically pass the negation through the set...so you'd have something like this instead:

if (intPosHomeUS <= 0 || intPosHomeUK <= 0 || (intPosHostUK > 0 && intPosHostUS > 0))

It's just DeMorgan's Law...you can find more about it here[^].
GeneralRe: if statement Pin
Dan Neely2-Nov-06 4:11
Dan Neely2-Nov-06 4:11 
AnswerRe: if statement Pin
Guffa2-Nov-06 4:37
Guffa2-Nov-06 4:37 
AnswerRe: if statement Pin
ednrgc2-Nov-06 6:23
ednrgc2-Nov-06 6:23 
QuestionKeys shortcuts problem Pin
Tavbi2-Nov-06 1:19
Tavbi2-Nov-06 1:19 
AnswerRe: Keys shortcuts problem Pin
luckykhalid2-Nov-06 1:29
luckykhalid2-Nov-06 1:29 
GeneralRe: Keys shortcuts problem Pin
Martin#2-Nov-06 1:31
Martin#2-Nov-06 1:31 
GeneralRe: Keys shortcuts problem Pin
Tavbi3-Nov-06 1:21
Tavbi3-Nov-06 1:21 
GeneralRe: Keys shortcuts problem Pin
Tavbi3-Nov-06 1:28
Tavbi3-Nov-06 1:28 
AnswerRe: Keys shortcuts problem Pin
Martin#7-Nov-06 1:32
Martin#7-Nov-06 1:32 
GeneralRe: Keys shortcuts problem Pin
Tavbi8-Nov-06 4:15
Tavbi8-Nov-06 4:15 
QuestionLinq - Problems with conversion [modified] Pin
Storme2-Nov-06 1:05
Storme2-Nov-06 1:05 
AnswerRe: Linq - Problems with conversion Pin
ednrgc2-Nov-06 6:27
ednrgc2-Nov-06 6:27 
GeneralRe: Linq - Problems with conversion Pin
Storme2-Nov-06 6:52
Storme2-Nov-06 6:52 
GeneralRe: Linq - Problems with conversion Pin
ednrgc2-Nov-06 6:55
ednrgc2-Nov-06 6:55 
GeneralRe: Linq - Problems with conversion Pin
Storme2-Nov-06 7:05
Storme2-Nov-06 7:05 
GeneralRe: Linq - Problems with conversion Pin
ednrgc2-Nov-06 6:59
ednrgc2-Nov-06 6:59 
QuestionChanging a Color on the fly Pin
Gareth H2-Nov-06 0:53
Gareth H2-Nov-06 0:53 

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.