Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1048811
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T16:30:59+00:00 2026-05-16T16:30:59+00:00

If I have the following … a OrElse b … and a is True

  • 0

If I have the following …

a OrElse b 

… and a is True then clearly b is never evaluated. But if I add an Or, then what?

a OrElse b Or c

Does/should c get evaluated? And what if I put in some brackets?

Apologies if this is basic. Of course I can test for the answer myself but I can’t find this question answered here or elsewhere. Lots of questions dealing with Or versus OrElse but nothing dealing with Or with OrElse

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T16:31:00+00:00Added an answer on May 16, 2026 at 4:31 pm

    This is an operator precedence problem. The relevant documentation is here:
    http://msdn.microsoft.com/en-us/library/fw84t893.aspx?ppud=4

    The important excerpts:

    • Operators with equal precedence are evaluated left to right in the order in which they appear in the expression.

    and

    Inclusive disjunction (Or, OrElse)

    So what we learn here is that Or and OrElse have the same precedence and that operators with the same precedence are evaluated from left to right.

    Therefore, I would expect that in cases where a is true, b is not evaluated. However, c still will be. In cases where a is false, b is evaluated and regardless of the b‘s value the Or operator will evaluate c. So, yes, c is always evaluated.

    As a practical matter, you should generally prefer OrElse in your code unless you have a good reason to use Or. Or exists now mainly for backwards compatibility.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have following code in VS2008 If Linq.Enumerable.Contains(Of String)(selectedUsersRoles, RoleCheckBox.Text) Then RoleCheckBox.Checked = True
Have following branches structure: master / \ BranchA BranchB But it should be: master
I have following in xml I wanna put the second linear layout at the
I have following script: #!/usr/bin/python while True: x = raw_input() print x[::-1] I am
Have following code: public interface ITest { string St1 { get; } } public
I have following code to join multiple files together. It works fine but I
I have following code: Tools::Logger.Log(string(GetLastError()), Error); GetLastError() returns a DWORD a numeric value, but
I have following ant file to build. But unfortunately <project default=build.deploy.start basedir=.> <property name=target.dir
I have following helper which should puts day in words depends on number: def
I have following problem: My program should decide at runtime to load an function

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.