Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Using of AndAlso
Message
From
01/09/2011 10:37:20
 
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Environment versions
Environment:
VB 9.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01522454
Message ID:
01522469
Views:
34
>If the first condition is false, we don't need to evaluate the second. AndAlso only evaluates the second condition if the first is true. According to the linked article, both conditions will be evaluated if you used And. In other words, it seems we always want to use AndAlso in VB.NET instead of And

Yes, this will save on verification on that line to avoid continuing for nothing. But, I took the approach of indenting all conditions instead of making them in one big line. This gives me more flexibility and much easier to understand for a newcomer.
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Previous
Reply
Map
View

Click here to load this message in the networking platform