compund conditional statements

  • Thread starter Thread starter cs_hart
  • Start date Start date
C

cs_hart

Can anyone tell me why the following causes an exception at eof?
inStr = essayRdr.ReadLine
While (Not inStr Is Nothing) And (inStr.Trim.Length = 0)

in c++, the first test will fail and the second will not be checked,
but it appears that VB is checking the second even after the first has
failed.
 
use AndAlso

this is referred to as a short-circuit operator

Greg
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top