Quantcast
Channel: How to use OR in IF, ELSE, THEN Condition - VB.Net - Stack Overflow
Viewing all articles
Browse latest Browse all 4

Answer by Marc B for How to use OR in IF, ELSE, THEN Condition - VB.Net

$
0
0

You're using OR, which means the if() test can bail out as soon as ANY of the conditions evaluate to boolean TRUE. e.g.

 FALSE or FALSE or FALSE or TRUE or FALSE .... FALSE = TRUE

If your .Text is NOT equal to "Egan Jones", then that's "true", and the rest of the statement becomes irrelevant and execution will skip straight into the 'true' clause.

You want AND instead.

TRUE and TRUE and FALSE and TRUE ... = FALSE

Viewing all articles
Browse latest Browse all 4

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>