Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

What's the best way to write the following:

 

If a = b Or a = c Or a = d Or a = e Then
...

To err is human, to really foul things up requires a computer.
  • *Experts*
Posted
Or is for boolean math, OrElse is for logical comparison. It's basically Or in VB is | in C++, and OrElse in VB is || in C++. I believe it will evaluate each expression individually and if it is false, it'll evaluate the next one, and if it's true it'll go right into the If block.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...