473,406 Members | 2,698 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

VB.NET Compiler

Hi

as much as I know from univsersity compilers dowsn't check another
statements after they find a TRUE statement.
example:

a=1
b=2
if a=1 or b=3 then
.....
end if

Because a=1 statement is TRUE, the compiler shouldn't check the
statement b=3 (because there's "OR" between them)

I can't understand why the VB.NET (VS 2003) insist to check all the
statements.....????!?
How Can I change it ?

Thanks
Yhlove

Mar 7 '07 #1
4 1684
You want to use "Short-Circuiting" logic. Use OrElse instead of Or and
AndAlso instead of And.

PJ Simon

"yh****@gmail.com" wrote:
Hi

as much as I know from univsersity compilers dowsn't check another
statements after they find a TRUE statement.
example:

a=1
b=2
if a=1 or b=3 then
.....
end if

Because a=1 statement is TRUE, the compiler shouldn't check the
statement b=3 (because there's "OR" between them)

I can't understand why the VB.NET (VS 2003) insist to check all the
statements.....????!?
How Can I change it ?

Thanks
Yhlove

Mar 7 '07 #2
On Mar 7, 6:28 pm, pjsimon <pjsi...@discussions.microsoft.comwrote:
You want to use "Short-Circuiting" logic. Use OrElse instead of Or and
AndAlso instead of And.

PJ Simon

"yhl...@gmail.com" wrote:
Hi
as much as I know from univsersity compilers dowsn't check another
statements after they find a TRUE statement.
example:
a=1
b=2
if a=1 or b=3 then
.....
end if
Because a=1 statement is TRUE, the compiler shouldn't check the
statement b=3 (because there's "OR" between them)
I can't understand why the VB.NET (VS 2003) insist to check all the
statements.....????!?
How Can I change it ?
Thanks
Yhlove- Hide quoted text -

- Show quoted text -
Thanks!
It works well.

Mar 7 '07 #3
Who needs and/or anyway? It's pretty lame having to type AndAlso and OrElse all day long but that's VB .NET

AndAlso -lame
&& -lame
and -good, Boo and IronPython got this right I think

yh****@gmail.com wrote:
On Mar 7, 6:28 pm, pjsimon <pjsi...@discussions.microsoft.comwrote:
>You want to use "Short-Circuiting" logic. Use OrElse instead of Or and
AndAlso instead of And.
Mar 7 '07 #4
AndAlso did not exist in VB6. When MS developed VB.Net, they added AndAlso
and OrElse rather than changing And and Or because there are cases where
you still want to use And and Or. They also didn't change it because it
would have made it a lot more difficult for people to convert their VB6
projects to VB.Net. They would have to check every single And and Or in a
project if all of them got converted to AndAlso and OrElse logic.

Robin S.
--------------------------------
"stax" <no****@please.nowrote in message news:es**********@online.de...
Who needs and/or anyway? It's pretty lame having to type AndAlso and
OrElse all day long but that's VB .NET

AndAlso -lame
&& -lame
and -good, Boo and IronPython got this right I think

yh****@gmail.com wrote:
>On Mar 7, 6:28 pm, pjsimon <pjsi...@discussions.microsoft.comwrote:
>>You want to use "Short-Circuiting" logic. Use OrElse instead of Or and
AndAlso instead of And.

Mar 7 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Jeff Epler | last post by:
Hello. Recently, Generator Comprehensions were mentioned again on python-list. I have written an implementation for the compiler module. To try it out, however, you must be able to rebuild...
13
by: Bryan Parkoff | last post by:
You may notice that switch (...) is much faster than function that can gain a big improved performance because it only use JMP instruction however function is required to use CALL, PUSH, and POP...
10
by: Bjorn | last post by:
I'm using interfaces in C++ by declaring classes with only pure virtual methods. If then someone wants to implement the interface they needs to inherit from the class. If the implementing class...
7
by: Tao Wang | last post by:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi, I saw cuj's conformance roundup, but the result is quite old. I think many people like me want to know newer c++ standard conformance test...
14
by: joshc | last post by:
I'm writing some C to be used in an embedded environment and the code needs to be optimized. I have a question about optimizing compilers in general. I'm using GCC for the workstation and Diab...
16
by: pj | last post by:
(Was originally, probably wrongly, posted to the vc subgroup.) (This doesn't appear to be a c# problem, but a problem with a bug in the Visual Studio c# compiler, but, any help will be welcome...)...
0
by: rollasoc | last post by:
Hi, I seem to be getting a compiler error Internal Compiler Error (0xc0000005 at address 535DB439): likely culprit is 'BIND'. An internal error has occurred in the compiler. To work around...
3
by: Mark Rockman | last post by:
------ Build started: Project: USDAver2, Configuration: Debug .NET ------ Preparing resources... Updating references... Performing main compilation... error CS0583: Internal Compiler Error...
6
by: toton | last post by:
Hi, Anyone have a link to comparative study of different C++ compilers and how much they conform to C++ language standard? Most of the big platforms I know have GCC which well supports C++...
41
by: Miroslaw Makowiecki | last post by:
Where can I download Comeau compiler as a trial version? Thanks in advice.
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.